Rotate hover car according to surface normal

Looking at the video the problem seems to be with the Orientation of the hovercraft turning sideways which messes up the subsequent raycasting and causes the weird behavior.

The code related to it is this.

The issue is that the second parameter using average normal times height is…weird I don’t know what lookAt point that is relative to the world origin (0,0,0) you are trying to achieve with the second parameter.

I believe the solution is to take notes at this community resource to see how @Quasiduck rotates his horse to be normal to the ground and apply it to your hovercraft.

Specifically using CFrame.fromMatrix instead of CFrame.lookAt which uses the world position of two positions within the world.

	bg.CFrame = CFrame.fromMatrix(pos, rightVector, upVector)*CFrame.Angles(0, TurnSpeed*(a-d), 0)
4 Likes