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

How would I move a CFrame without changing the rotation?

I am trying to make a CFrame move but it keeps rotating and nothing I am doing is working. Could anyone show me some examples of how I would move a CFrame without rotating it?

4 comments

0

Could we see the Script?

0

check out the operations section here : http://wiki.roblox.com/index.php?title=CFrame#Operators

0

theking48989987 see on the developer.roblox.com not wiki.roblox.com, the wiki have deprecated's of the CFrame, ex: CFrame:inverse() is deprecated use CFrame:Inverse(). here is the updated wiki page: https://developer.roblox.com/api-reference/datatype/CFrame

0

ahh, ok

1 answer

✓ Accepted answer

okay not really sure what the issue is, but if you want to change a CFrame's position without changing its rotation then you can either multiply it by another CFrame without rotational properties or add a Vector3 to it.

cf = cf*CFrame.new(0,0,-3)

this will shift the part 3 studs forward in its local space, i.e. in the direction it's facing. so if it's facing east, it'll move 3 studs east.

cf = cf+Vector3.new(0,0,-3)

meanwhile, this will shift the part 3 studs forward using global space. so no matter what direction the part is facing, it'll move 3 studs north.

if this is elementary stuff and your issue isn't with this then you have to specify on what your issue is

1 comment

0

oh lol just saw your other thread. i'll post in that in a bit

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