[BUG]Character jiggle after arriving at destination point

I have an issue where the player will reach the destination and will the start a slow spin jiggle. I have checked my mover code as well as my controller code, also redone my navmesh.
I suspect that the player reaches the destination but not 100%, it then tries to correct but cannot get there as it is a very small movement. This is just a guess.
This does not happen all the time but fair to say 80% after a move click.
If anyone could point me in the direction where I can start looking I would greatly appreciate it, short gif below of issue

The player is “close” to the destination, but it’s hard to get the exact spot, so the agent keeps trying.

Try checking to see if the character is within a unit of the target destination, and if it is:

GetComponent<NavMeshAgent>().position = transform.position;
Cancel();

Thank you very much. Worked like charm, used the below:

public void ProximityCheck()
{
if(Vector3.Distance(transform.position, navMeshAgent.destination) < proximitylenght)//Fixed but with player failing to find exact desitnation
{
GetComponent().destination = transform.position;
Cancel();
}
}

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms