I’m using the NavMeshAgent.Move API, passing it an offset vector.
The agent does not have a path defined or request – in other words, I’m moving as if it was a character controller.
I’m experiencing very odd behavior where the same build moves the character at a meaningfully different rate in response to the same vector on different computers.
Has anyone seen anything like this or can explain why it happens?
I know this question is old but it came up third in my search results and I hate unanswered questions.
Chances are, you’re calling “Move” each frame without accounting for different framerates. Multiply the amount you’re moving by Time.deltaTime.
// A unit Vector describing the direction you want to move.
Vector3 Direction;
// How fast you want to move in the Direction.
float Speed;
agent.Move(Direction * Speed * Time.deltaTime);
Time.deltaTime is the change in time since the last frame (the time it took for the last frame to compute). You want to move Speed units per second so by multiplying by Time.deltaTime, you link your Move to the time that has passed rather than to the framerate.