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

What is " .lookVector " ?

Asked by 9 years ago

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

2 answers

Log in to vote
4
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
9 years ago

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.

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) tumadrina 179 — 9y
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 Perci1 4988 — 9y
Ad
Log in to vote
0
Answered by 5 years ago

Hi, what is the *300 for?

0
its the Speed :) FelixTheDev 0 — 3y

Answer this question