Log in to vote

What is " .lookVector " ?

Asked by 4 years ago

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

1 answer

Log in to vote
Answered by
Perci1 4868 Trusted Moderation Voter
4 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.

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 152 — 4y
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 4868 — 4y

Answer this question