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

What is " .lookVector " ?

I saw this in a Elevator Script, what does it mean?

2 answers

✓ Accepted answer

lookVector is a property of CFrame that is basically the direction a part is facing. For example, if you were do to this code:

workspace.Part.Velocity = workspace.Part.CFrame.lookVector * 300

It would make the part fly forward; aka it would fly in the direction it is facing. The way a part is facing is determined by it's front face. lookVector is very useful for gun scripts, as it lets you make the bullet shoot towards the direction it's facing.

Comment if you have more questions.

2 comments

0

I have a question, how would you go about making it go to the left by the way its facing?(sorry if this isn't clear)

1

Yeah I was wondering about that as well. I don't know how to do it. You would probably need to do some math

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