How to make part tilt based on the parts it on

Yep this is correct, using more rays will get a better average of the surface. A minimum of three rays is needed to form a mathematically flat plane which represents the surface.

Example project which uses three rays in this manner:

For the rotation bit you can use also this CFrame technique:

1 Like