- Home /
Can we use Navmesh for Player without relying on SetDestination ?
I was setting up a NavMesh for some AI today, and some path like hills etc... are not accessible with my current config of the nav mesh (this is correct.)
But, with my player, I can sometimes go out of the navmesh, and the NPC will never be able to reach the player. So I tried to add a NavMeshAgens to my player, and move it using the controller (no point and click) by doing :
Vector3 position = (transform.forward * direction.z * moveSpeed) + (transform.right * direction.x * moveSpeed);
agent.Move(position.normalized);
Problem is, although the obstacle and movement works ok, I can't find a way to use the NavMeshAgent value of speed/acceleration etc... when using this method, so I can't set my animation properly.
Is moving a player with NavMeshController OK when NOT doing point and click ? And how to use the speed/acceleration of the agent instead of manually creating variable in script ?
Your answer
Follow this Question
Related Questions
Problem with Navmesh 1 Answer
Network and NavMeshAgents 0 Answers
Nav Mesh Agent not smooth 1 Answer
Tank not moving towards player 1 Answer
NavMeshAgent Collision 1 Answer