tweaks to navmesh
This commit is contained in:
parent
2831f9620e
commit
20754c6c73
2 changed files with 5 additions and 1 deletions
|
@ -98,6 +98,7 @@ polygon = PackedVector2Array(32, -25, 33, 24, 269, 129, 269, -126)
|
|||
[node name="Navigation" type="NavigationAgent2D" parent="."]
|
||||
avoidance_enabled = true
|
||||
radius = 60.0
|
||||
max_speed = 150.0
|
||||
debug_enabled = true
|
||||
|
||||
[connection signal="velocity_computed" from="Navigation" to="." method="_on_navigation_velocity_computed"]
|
||||
|
|
|
@ -12,7 +12,10 @@ func _physics_process(delta):
|
|||
if not $Navigation.is_target_reachable():
|
||||
go_to_interesting_spot()
|
||||
|
||||
$Navigation.velocity = position.direction_to($Navigation.get_next_path_position()) * 100
|
||||
var pos = $Navigation.get_next_path_position()
|
||||
var dir = position.direction_to(pos)
|
||||
$Navigation.velocity = dir * 1000
|
||||
transform = transform.looking_at(pos)
|
||||
|
||||
func say_shit(shit):
|
||||
print(self.name, ": ", shit)
|
||||
|
|
Loading…
Reference in a new issue