Page tree
Skip to end of metadata
Go to start of metadata


Introduced in

Version:1.00

Description

Description:Sets object heading.

Angles are measured in degrees clockwise from north. The accepted heading range is from 0 to 360. Negative angles represent a counter-clockwise angle and the angle can be of any size.

If applied to AI units, they turn back (immediately, or after a few seconds) to their original orientation, unless their doWatch or setFormDir is adjusted as well.

Syntax

Syntax:object setDir heading
Parameters:
Return Value:Nothing

Examples

Examples:
Will point tank1 north-east:
tank1 setDir 45
Will point unit1 north-west:
unit1 setDir -45;

unit1 doWatch (unit1 modelToWorld [0,20,1]); // update the watch position, so the AI keeps the new direction

Additional Information

See also: getDir, setFormDir
Multiplayer:
Problems:

Notes







Posted on May 9, 2007 - 20:43 CET
Manny
Though effects of this command remain local, you can do a setPos afterwards to synchronize the direction on all machines in MP. myObj setDir 90; myObj setPos getPos myObj;
(this is obsolete from 2.12)