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

How to move a part along it's faces. I do **NOT** want it to move along it's front face?

I understand that if you want to have a part move along its front face, you use lookVector, but what if I want to move it along its back face? How would I do so without changing the orientation? Is there such a possible feature? I search the entire web but found nothing.

4 comments

0

-LookVector or LookVector*-1

0

How about side faces. :V lmao

0

RightVector, -RightVector, UpVector, -UpVector

0

Oh :v

1 answer

I'm going to assume you want to change its CFrame to go in the direction you want. In that case, use multiplying CFrames. You just have to know the relative direction of the direction you want to go in. For example, for backwards, as you asked in your question, use the Positive Z direction. NOTE: CFRAME MULTIPLICATION IS NOT COMMUTATIVE. THIS MEANS: cf1 * cf2 ~= cf2 * cf1

--Make sure there is a reference to your part called "part"
local studsToMove = 10
part.CFrame = part.CFrame * CFrame.new(0, 0, 1 * studsToMove)

1 comment

0

Hmmm, seems to work, I'll test it out and accept the answer if it's correct. Thanks!

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