Entity/AlignAngles

From Garry's Mod
Jump to: navigation, search
 Entity:AlignAngles( )

Contents

Description

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

NOTE

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

Arguments

Angle from

The angle you want to align from

Arguments

Angle to

The angle you want to align to

Returns

Angle

The resulting aligned angle

Examples

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.
Personal tools
Navigation