Object Snap to Surface Rotation

Hey there,

Recently I’ve worked on a simple rain system that allows for realistic rain, the drops don’t go through roofs and turn into puddles once they hit the ground.

What I’m looking forward to achieve is that, if the water drop hits a slope or an edge, it’s able to adjust its position to match the rotation of surface it’s touching.

Here’s an image to better represent.

The last puddle of water isn’t following the rotation of the surface it’s touching.

I am absolutely terrible at scripting but I think raycasting might help you accomplish that

Try this post I don’t know if this works for slopes

Theres this thing in RaycastResult called “Normal” (I assume you are using Raycast)

I used this to make functional bullet holes for my gun system, heres how I did it:

hole.CFrame = CFrame.new(result.Position, result.Position + result.Normal) -- result = RaycastResult

To make it actually work like intended, cause I’m using a decal, I put the decal on the front side of it. I assume you are using unions, the top of the puddle should be the Front side of the union.

3 Likes

Didn’t mark this one as a solution cause the other one, about Raycasts, was more straight forward. Thanks for the help anyways!

No problem man, Good luck on your project!

How would I do this using Mouse.Target? I’m either using the raycast wrong, or the raycast is deciding to be unreliable and barely work half the time.