How can I get the rotation of a surface?

Hi devs,

I’ve been trying to place parts on the mouse’s position and rotate it based on the rotation of the surface of the mouse’s target, but I’m not sure how I can do this.
How could I do this?

1 Like

You can try something with Mouse.TargetSurface. I do warn you that the mouse is deprecated.

Is there a way to get the rotation of the face?

Not sure if mouse supports rotation, but raycast does. You could fire a raycast from the camera to the part and then fetch the rotation from there.

2 Likes

Functionally deprecated. It won’t be deprecated any time soon (since plugins use it all the time), don’t worry.