- Home /
Using NavMesh and I am unable to see the agent
I am using the built-in unity nav system.
I have the NavMesh and NavMeshAgent all setup and all aspects seem to be working correct except for one.
When running the game i can see that the enemy is moving along the path toward the target by watching the position coordinates in the editor. I can be hurt by him and kill him. But the enemy is not visible. Am I missing a setting here or any ideas what is up? Do you need more information?
Thanks
Sounds to me as if the Renderer Component of your Enemy is disabled. I don't think this could be caused by the Nav System. $$anonymous$$aybe pause the game and crosscheck what it is that hides your enemy. You can select the GameObject and check if the Object self and all needed Components are enabled.
@ElDo When I run the game with the Nav $$anonymous$$esh Agent enabled you can't see the enemy, but when I uncheck the Nav $$anonymous$$esh Agent in the inspector and then run the game you can see the enemy. I don't know what it is about running the Nav $$anonymous$$esh Agent that hides the enemy.
The $$anonymous$$esh Renderer is enabled and I still can't see them. Does the Nav $$anonymous$$esh only work with certain types of shaders?
So I figured out the problem is that the Nav $$anonymous$$esh Agent is changing the x rotation of the object to where it can't be seen. How can I specify the x rotation while using Nav $$anonymous$$esh.
Answer by themgsman · Nov 09, 2015 at 06:18 AM
I solved this myself. Once I figured out the rotation was the issue. I added code to stop the Nav Mesh from updating the rotation and then set the rotation manually.
agent.updateRotation = false;
transform.rotation = Quaternion.Euler(270,180,0);
Your answer
![](https://koobas.hobune.stream/wayback/20220612044326im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Baking a nav mesh through a tunnel 3 Answers
Runtime Navmesh not working on mobile build 0 Answers
Make a flying enemy ? 0 Answers
Navmesh agent forward movement 1 Answer
How to do AI pathfinding on trees and other vertical surfaces? 0 Answers