improve navigation

godot-4.2
John Montagu, the 4th Earl of Sandvich 2023-12-09 23:45:27 -08:00
parent 388c2a0e4c
commit 7cfb8baac6
Signed by: sandvich
GPG Key ID: 9A39BE37E602B22D
3 changed files with 53 additions and 16 deletions

View File

@ -12,7 +12,7 @@ public partial class DynamicDoorSwitch : StaticBody2D
public string MapStateKey { get; set; }
[Export]
public Godot.Collections.Array<NodePath> VisibleOnToggle { get; set; } = new();
public Godot.Collections.Array<NodePath> VisibleOnToggle { get; set; }
private AnimationPlayer _animPlayer;

File diff suppressed because one or more lines are too long

View File

@ -57,11 +57,6 @@ public partial class PursueState : ThinkerState
public override ThinkerState PhysicsProcess(double delta)
{
//if (!NavigationAgent.IsTargetReachable())
//{
// return PassiveState ?? base.PhysicsProcess(delta);
//}
var navPos = NavigationAgent.GetNextPathPosition();
NPC.Direction = NPC.GlobalPosition.DirectionTo(navPos);