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

How do you move a part using CFrame without changing the rotation?

Can be used when making a part rotating in Y axis but also allow it to move around and affect by things like gravity, pushes, or rotate in another axis but still let the Y axis rotating by itself

2 comments

0

You can use (part.CFrame - part.Position) to just get the rotation of the part. But you can also add a vector3 to a CFrame to "Returns CFrame translated in world space by Vector3".

0

doesn't work :/

2 answers

Goto.CFrame = CFrame.new(This.Position)

5 comments

0

you got the wrong idea

0

That is literally what it is. It goes to the CFrame but it doesn't rotate. Via "move a part using CFrame without changing the rotation"

0

Wait I didn't read the other stuff.

0

Make a BodyGyro object, with the MaxTorque 400000, 400000, 0

0

Well, the title was quite wrong. I want it to keep it's rotation, means that I want the part to rotate on it's own whenever it's being moved by CFrame.new(). And even if it's affected by gravity or pushes, it will still rotate in that axis

I answered this question here

But in your case you aren't using mouse so I'll go over it real quick

part = workspace.Part
position = Vector3.new(1,0,1)

part.CFrame = part.CFrame + (position - part.Position)

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