12 lines
374 B
GDScript
12 lines
374 B
GDScript
extends Node2D
|
|
|
|
@onready var navigation_polygon: Polygon2D = $NavPolygon2D_1
|
|
@onready var graph: NavigationGraph = $NavGraph
|
|
@onready var character: CharacterBody2D = $CharacterBody2D
|
|
|
|
func _ready() -> void:
|
|
navigation_polygon.hide()
|
|
var polygons = Geometry2D.decompose_polygon_in_convex(navigation_polygon.polygon)
|
|
|
|
graph.erase_and_create_nodes_from_polygons(polygons)
|