How to make CFrame relative to world space?

If you have a rotated object and you do
object.CFrame *= CFrame.new(0,-1,0)

It’s gonna move the object down relative to the object.

How would I move the object with CFrame relative to the world? I want to have the same result as if I used object.Position += Vector3.new(0,-1,0)

I did try the CFrame methods, but wasn’t successful in that

If you add a Vector to a CFrame that is in world space (A Part’s CFrame is in world space), it will offset that CFrame in world space as well.
cf += Vector3.new(0, -1, 0)

4 Likes

Convert the desired world-space transformation to the object’s space. E.g.

local worldSpaceTransform = CFrame.new(0, -1, 0)
local objectSpaceTransform = object.CFrame:ToObjectSpace(worldSpaceTransform)
object.CFrame *= objectSpaceTransform
1 Like

This did work but it messed with the orientation/rotation. Maybe because I’m using it on a weld.C0

You’ll need to alter the CFrame and then reconstruct the weld afterwards with the brand new C0.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.