Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would you get the face of a part and CFrame another part onto it?

Say theres a 4x4x4 cube. If I clicked on the "top" face with my mouse then a part would spawn onto that face whose orientation is perpendicular to the surface. Is there any method to obtain that "face" and CFrame something onto it?

I tried mouse.TargetSurface, didn't work out really well.

1 answer

✓ Accepted answer

You can get the CFrame of the middle of the surface by using Part.CFrame*CFrame.new(Part.Size*.5*mouse.TargetSurface)

Multiplying CFrames translates by the second relative to the first.

This discussion is preserved as it was. New answers, comments, and votes are closed.