Vector:DotProduct
Description
We advise against using this. It may be changed or removed in a future update.
This is an alias of Vector:Dot. Use that instead.
Returns the dot product of the two vectors.
Arguments
Returns
Example
A function to make sure the player is looking somewhere.
function IsLookingAt( ply, targetVec )
return ply:GetAimVector():DotProduct( ( targetVec - ply:GetPos() + Vector(70) ):GetNormalized() ) < 0.95
end
Output: Returns true if ply is looking at (or close to) the target.