- Home /
How to control a NavMeshAgent's rotation ?
Hello,
I am trying to use the navmesh system for my game (RTS). I am using Unity free but thankfully NavMesh has been added in the latest version, though some things are restricted. Anyway, the navmesh is working fine so far and my unit goes to its destination as planned. However, it rotates in a "weird" way. What I mean is that my unit is made of a cube and a capsule (obviously this is placeholder while I learn how to use this stuff), and the capsule is intended to be the "front", but the unit rotates until its "side" appears first, like if it was strafing. Here are two screens showing what I mean : the first pic represents what actually happens, the second what I want to happen.
First picture : http://i.imgur.com/s8GZZo2.png
Second picture : http://i.imgur.com/z0FeVPf.png
Obviously there is a way to say what is the "right rotation" since Unity is using it right now, just not the one I want. And besides, I suppose that when I import 3D models from the Assets store, I will not have this issue because the "right rotation" will be written somewhere. But can I control it with a simple prefab and not an actual model ?
I'm sure the answer is something very silly but I can't find it right now.
Answer by Custardcs · Sep 01, 2015 at 10:34 AM
Hey bud this might be a bit late but had the same issue as far as
you can place a gameobject.. and a model under then rotate the model to face the direction of the game object BLUE axis.. normally -90 on y does the trick for me...
then when you move it the unit goes straight and does not face a funny direction