- Home /
Root Motion and Navmesh Agent
Hey there, I am trying to get an AI working by using root motion.
Actually the enemies are walking correctly (speed) but the stopped walking arround objects (they just run towards the character even if they run against a wall i.E).
private void Update() {
anim.SetFloat("vertical", agent.speed);
target = gameManager.player.transform;
agent.SetDestination(target.position);
}
private void OnAnimatorMove() {
if(target)
agent.velocity = anim.deltaPosition / Time.deltaTime;
}
Why isn't the agent for valid path anymore when i use OnAnimatorMove and the agent speed as animator parameter?
Greets!
Are your walls static, and if you have obstacles do they have a "Nav $$anonymous$$esh Obstacle", and did you bake the navmesh?
Hi yeah every thing works when i dont use the code from above. No problem which navmesh and obstacles.
Greets
Your answer
Follow this Question
Related Questions
Multiple agent types problem - NavMesh 0 Answers
NavMesh does not working... 0 Answers
Reasons an NavMesh Agent.isStopped might be set to True? 0 Answers
Navmesh one way gate 0 Answers