Added better nav stuff
parent
af0d9d57e0
commit
391b026c84
|
@ -14,3 +14,7 @@ config/name="pathfinding-algorithms"
|
|||
run/main_scene="res://scenes/tilemap_nav.tscn"
|
||||
config/features=PackedStringArray("4.3", "Forward Plus")
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
[navigation]
|
||||
|
||||
2d/default_edge_connection_margin=40.0
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
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()
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue