- Home /
Making enemies "fly" using NavMesh?
I've successfully gotten NavMesh to work, not that it was very difficult, and I can have the enemies move around on the ground and chase the player. But I want to have the enemies ignore gravity entirely, and be able to "float" after the player. Say, if the player were on a higher plane, the enemies would be able to float freely in 3D space.
Is there an easy way to do this? P.S. Take it easy, I'm a real noob at this.
Answer by Hellium · Jul 08, 2015 at 07:48 AM
The NavMeshAgent class provide the following attribute which is clearly what you are looking for :
// C#
GetComponent<NavMeshAgent>().baseOffset
See doc : http://docs.unity3d.com/ScriptReference/NavMeshAgent-baseOffset.html
The documentation and manual give the following definition :
The relative vertical displacement of the owning GameObject
Offset of the collision cylinder in relation to the transform pivot point.
Have you been able to achieve what you wanted to do @D-PadRadio ? Don't forget to feedback for the community ! ;)
I greatly appreciate your help and the generosity of the Unity community! However, I decided it was easier to use Vector3.$$anonymous$$oveTowards rather than giving the enemies AI.
Your answer
![](https://koobas.hobune.stream/wayback/20220611230251im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unity 3.5: Is there a way to access a NavMeshAgent's current path? 1 Answer
Navmesh Teleporting (With Server) 1 Answer
How to sample a point on a navMesh Agent path 0 Answers
Nav Mesh Agent 1 Answer