Follow surface (Again) PLZ HELP!

Hi all,

I’ve been trying to tackle this for ages, what at first seemed to be a simple problem is now the bain of my life…

I’m trying to get a model to follow the surface of a terrain / any mesh. I’ve looked through the forums and it seems there are many solutions but one of them are working for me.

Can someone plz take a look at this and tell me what I’m doing wrong?

http://pastebin.com/DkWxci8Y

using ‘transform.rotation = Quaternion.FromToRotation(Vector3.up, AverageNormal);’ works brilliantly but locks my rotation so I opted for ‘LookRotation’ instead using average normals of the forward and backward rays. This works to a degree but moves my GO all over the place. Does anyone have a solution?

Thanks!

267965–9638–$hover_750.unitypackage (16.8 KB)

Is the vehicle supposed to be able to move anywhere on the terrain in 3D? With the side-pointing camera, it’s not clear if it’s a 2.5D game or not.

It’s supposed to be able to move anywhere over any mesh. Like a spider running across the floor and up a wall, etc.

The side camera was so I could properly illustrate which way the GO was orienting itself and also see how the updates were working using the gizmos to show each ray and corresponding normal.

I’m still stuck with this one so any suggestions are super-welcome!