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

How do I properly use lookVector?

Asked by 7 years ago
Edited 7 years ago

Hey there, I'm really confused on how to use lookVector. Currently, I am working on a way to deflect rays off of a part. I'm not sure if I'm using lookVector correctly, but my idea is to use the lookVector to make it deflect off of the surface of the part. For the script handling the deflection, this is all I got.

shield.Touched:connect(function(hit)
    if hit.Name == "Shot" then
        local lookVector = shield.CFrame.lookVector
        local shot = hit:clone()

    else
    end
end)

The deflection is a clone on purpose, so at one point it will look something like this:

  \    I  
   \   I 
    \  I 
     \ I
----------------
0
shield is a var for script.Parent.Shield idkaname8 25 — 7y

Answer this question