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

16 lines
456 B
GDScript
Raw Normal View History

2024-11-07 18:11:31 +01:00
extends Node2D
@onready var floor: NavigationRegion2D = $BaseNavigationRegion2D
@onready var road: NavigationRegion2D = $CheapPathNavigationRegion2D
@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()