Overview
I’ve got a tank model that I’m currently planning out how it’ll calculate it’s rotation and height based on what’s below it. Every idea I’ve had to calculate it has flaws and I cant seem to come up with something consistent.
My attempts
First thought was to draw a raycast directly down from the center of the model, and just use the tangent line from the face it hit, however in that will lead to bad rotations in strange situations
Then I thought to draw raycasts directly down from the front and back of the tank to figure out where it will hit the terrain and then based on those calculate it’s updated rotation and Y value, but that has issues on hills positioning it slighly inside a hill.
I’m a little unsure about how to approach this if anyone has an idea I can test our let me know.