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

Move a part 2 studs towards the left face?

I know this isn't a request site, and I'm supposed to include what I've tried, but I just don't know where to start. I want to move a part to it's left face, so that I can rotate it without having to rescript it for each rotation. I've searched the web and found nothing. How would I do this?

1 comment

1

what do you mean?

3 answers

to rotate a part to the left, you can just do this

part.CFrame = part.CFrame * CFrame.Angles(0, math.pi/2, 0) -- pi radians = 180 degrees

if you mean actually baking that rotation into the part, so you don't have to apply it every time you change its CFrame, there's no way to do that within roblox itself

you can either create an entirely new part or export the part and rotate it in a 3d software like blender, then import it back in

if you're really lazy you can weld the part to another part at a 90 degree angle and change the CFrame of the other part, but that's kind of somewhat extremely hacky

There's a bunch of free models that do this. Search "Turning Part" on the toolbox. Using Vector3 might also help you.

3 comments

0

I couldn't find anything from that.

0

But thanks for trying.

0

:)

By the left face, you must mean sideways left?

workspace.Part.CFrame = workspace.Part.CFrame + (workspace.Part.CFrame.RightVector * -2)

to explain it you use -2 because it is the right side so you want to go negative and im not sure if there is a left vector if youre rotating it i would do something like this but i am not sure as of its accuracy

workspace.Part.CFrame = workspace.Part.CFrame * CFrame.Angles(0,math.rad(90),0)

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