Navmesh rotation

Hi guys,

I want to ask. Im making a car game and I want to have animated train (like gta san andreas/gta 5). Using animation is more complicated so I tried to use Navmesh and Navmesh agent.

It looks good, but it doesnt rotate on x, so when its go uphill and downhill it looks weird.

Is there a way how to enable rotation x?

Thank you

Good day.

Nav Mesh System will not rotate the object. You need to do it by code.

what you can do is to store the height coord from the transform, and check if its changing each update, with 2 float varbiables like LastHeight and CurrentHeight.

Each frame check if CurrentHeight is equeal, higher or lower than LastHeight, to modify the transform.rotation

And the last thing you do in the update is LastHeight=CurrentHeight.

And start again!

so you will be able to know if is going up or down.