Garry's Mod Wiki

Garry's Mod Wiki

  Angle Entity:AlignAngles( Angle from, Angle to )

Description

Returns an angle based on the ones inputted that you can use to align an object.

This function doesn't change the angle of the entity on its own (see example).

Arguments

1 Angle from
The angle you want to align from
2 Angle to
The angle you want to align to

Returns

1 Angle
The resulting aligned angle

Example

This example will make ent1 face up from ent2.

ent1:SetAngles(ent1:AlignAngles(ent1:GetForward():Angle(), ent2:GetUp():Angle()))
Output: Sets ent1's angle to one where ent1 faces up from ent2.

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