- Home /
Nav Mesh Agent makes object disappear!!! Help!!,Nav Mesh Agent makes object disappear!! Help
When I add a Nav Mesh Component to my enemy it makes it disappear when I start playing the game. When I take it off, I can see the enemy in-game and everything is fine???,When I add a Nav Mesh Agent to my enemy it disappears when I press play. When I take the Nav Mesh Agent Component off everything works fine and I can see the enemy.
Hey there,
can you please specify what "dissappear" means? deleted? misplaced?
Answer by hawksandwichgames · Oct 14, 2019 at 06:50 AM
Not sure if by "Nav Mesh Component" you mean NavMeshAgent or NavMeshSurface, but you should never add NavMeshSurface to an enemy -- that's for the environment.
As for why adding NavMeshAgent makes the enemy disappear, it could be that he's just teleporting to the nearest NavMeshSurface upon play.
After you start the game and the enemy disappears, select the enemy in the editor, put your cursor over the scene view, and press "f" on your keyboard. this will move your view to the enemy, so you can see where it is.
Answer by Megahertzs · May 15, 2021 at 06:59 AM
I know this question is almost a year old and I'm late to responding, but I thought I would leave this response here in case someone else ran into this issue.
If your Nav Mesh Agents are disappearing at runtime, it could be because you haven't set the Nav Mesh Agent Set Update Rotation & Set Update Up Axis to False. This was the case for me!
Hope it helps!