Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago

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

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". User#5423 17 — 6y
0
doesn't work :/ Konethorix 197 — 6y

2 answers

Log in to vote
0
Answered by 6 years ago
Goto.CFrame = CFrame.new(This.Position)
0
you got the wrong idea Konethorix 197 — 6y
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" GetGlobals 343 — 6y
0
Wait I didn't read the other stuff. GetGlobals 343 — 6y
0
Make a BodyGyro object, with the MaxTorque 400000, 400000, 0 GetGlobals 343 — 6y
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 Konethorix 197 — 6y
Ad
Log in to vote
0
Answered by
Vulkarin 581 Moderation Voter
6 years ago
Edited 6 years ago

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)

Answer this question