Garry's Mod Wiki

Garry's Mod Wiki

  Angle Vector:AngleEx( Vector up )

Description

Returns the angle of this vector (normalized), but instead of assuming that up is Vector( 0, 0, 1 ) (Like Vector:Angle does) you can specify which direction is 'up' for the angle.

Arguments

1 Vector up
The up direction vector

Returns

1 Angle
The angle

Example

Shows usage of the function

print( Vector( 0, 0, 100 ):AngleEx( Vector( 0, 0, 0 ) ) )
Output: Angle( -90.000, -0.000, 0.000 )

Example

Use forward and up vector to produce angle. These two lines below will return the same angle

local e = ents.Create("prop_physics") print(e:GetAngles()) print(e:GetForward():AngleEx(e:GetUp()))

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...