NavMesh freezing when getting coordinate passed from other gameobject
It works fine when get the Vector3 from within playerManager script, like this:
Vector3 ClickedPosition = MainCamera.ScreenToWorldPoint(Input.mousePosition);
agent.SetDestination(ClickedPosition);
This is where it gets weird. When I get the Vector3 from a public function on a different script that returns a vector3 of the location of a transform, the player does not move. But, if I click away from the game window, onto the editor and then back to the game window, it glitches/snaps towards the correct location. I can click on and off the screen again and again to get it to keep moving, but it never moves while on the game window. It always moves in fixed increments, regardless of time.
Comment