CRaPI - Correct Robust and Perfect API

BasicActions.TurnToObject Method (Player, FieldObject, Command)

public static void TurnToObject(
   Player pPlayer,
   FieldObject pObject,
   out Command action
);

Parameters

pPlayer
The player
pObject
The object to look at
action
The action command for the turn

Remarks

The player is turned so the AbsoluteBodyDirection equals the angle between the players position and the object. This means that even if the object is visible before the turn, the object could go out of view after the turn. This method just makes sure the body has the right angle towards the object.

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicActions.TurnToObject Overload List | TurnToPoint