gai-godot-games/pathfinding-algorithms/scenes/tilemap_nav.gd

17 lines
533 B
GDScript

extends Node2D
@onready var floor: NavigationRegion2D = $BaseNavigationRegion2D
@onready var road: NavigationRegion2D = $CheapPathNavigationRegion2D
# @onready var road_poly: Polygon2D = $CheapPathNavigationRegion2D/CheapPath
@onready var road_poly: Polygon2D = $BaseNavigationRegion2D/CheapPath
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
setup.call_deferred()
func setup():
road_poly.hide()
road.navigation_polygon.add_outline(road_poly.polygon)
road.bake_navigation_polygon()