How would I change the orientation of the Primary Part according to the sphere of the terrain?

image

I was wondering if it was possible to change the orientation of the Primary Part according to the shape of the sphere. I already tried to look up information of this topic. But I didn’t have any luck finding any. I have seen this done in Booga Booga. And Vesteria. I was wondering if anyone knew a solution to this problem.

1 Like

So two ways I can think of going about this.

  1. Raycast down from the animal and use the surface normal to determine rotation

  2. Raycast down from the front and back of the animal and use the two hit vectors to find rotational normal of the ground and adjust animal position accordingly.

As above, but if you wish to know more - Raycasting: how do i do it