I’m having some difficulty with this one. When my enemy makes it to the destination point, the 3d agent never indicates that navigation has finished. I found if I increase the Desired Distance variables, it sort of works, but then the enemy stops far away from the path node. Not sure what I’m missing here.
Here’s some debug output when it’s right on top of the target location but still not considered finished:
If I increase the desired distance it works but the distance is stops at doesn’t match the desired distance I set:
How can I make it actually stop when it’s supposed to? My current EnemyReturnState physics process method looks like this:
public override void _PhysicsProcess(double delta)
{
GD.Print("Disatance to Target: " + characterNode.AgentNode.DistanceToTarget());
GD.Print("Path Desired Distance: " + characterNode.AgentNode.PathDesiredDistance);
GD.Print("Target Desired Distance: " + characterNode.AgentNode.TargetDesiredDistance);
GD.Print("Is Finished: " + characterNode.AgentNode.IsNavigationFinished());
if(characterNode.AgentNode.IsNavigationFinished())
{
characterNode.StateMachineNode.SwitchState<EnemyIdleState>();
return;
}
characterNode.Velocity = characterNode.GlobalPosition.DirectionTo(destination);
characterNode.MoveAndSlide();
}