Garry's Mod Wiki
Example
Get the angle of two opposite normalized vectors.
Output: Radians 3.1415926535898
Degrees 180
Degrees 180
Example
Calculates whether the player is looking in the direction of an entity. This is often faster than traces, but it produces a slightly different result.
The player is looking in the direction of the entity if the angle between the aimvector and the vector from the player to the entity is less than 22.5 degrees (or pi / 8 radians).
Output: This script will say if the player is looking in the direction of the entity.
Example
A function to make sure the player is looking somewhere.
Output: Returns true if ply is looking at (or close to) the target.
This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.
Page content is automatically updated four times a day. Edits and history are not available.
Last Parsed: Loading...
