Hi. I was working with navigation meshes and agents and everything seemed to work just fine until I came across a problem when making a car use a navigation mesh and nav agent. It seems to head straight for the target regardless of what direction it is facing. The object does turn according to it's angular velocity but that has no effect on the way it moves. I keep getting the action on the left instead of what I want the car to do which is on the right. It looks really weird in the game. A car cannot travel sideways as it is constantly doing. Does anyone know what to do here?
Oh. That is what I was afraid of. So I guess I need to use the rotateTowards function and RigidBody.addVelocity to move the car more realistically. And for obstacle detection, raycast?
Sample asset package had some AI car demo also, https://www.assetstore.unity3d.com/en/#!/content/32351
I used wheel colliders for my vehicles, so I dont need to worry about adding force or torque. Its just a case of figuring out the correct steering angles (not too hard), and if you are wanting the car to go forward/back. Obstacle avoidance is generally raycast, but it depends on your terrain.