Rotate object inverse ground

I want to make a horse for my game and simple prototype will have horse based on Rigidbody…

I have problem: I want to horse be always pointing up from terrain something like spider pointing down when on ceiling and up if on floor and right if on wall… i figured out that i can get normals from raycast but i don’t know how to convert them to rotation… please help :slight_smile:

Here you go:

pass transform.Forward of the horse as first and the normal you received from the raycast as second parameter and set the horse rotation to the result.