Tasks

Your character can be controlled by your script, and given actions that override manual control of the player. These actions are called Tasks and in order to assign tasks to your characters we have to define your Game.Player as Game.Player.Character. The Game.Player.Character code gets the specific model of the character the player is controlling.

Now we can give tasks to the character by adding the Task function:

Game.Player.Character.Task

Finally we can specify what task to give the character by choosing a task from TaskInvoker list of possible actions.

Game.Player.Character.Task.Jump(); //Jump once
Game.Player.Character.Task.WanderAround(); //Wander around indefinitely
Game.Player.Character.Task.HandsUp(3000); //Hands up for 3 seconds
Game.Player.Character.Task.TurnTo(GameplayCamera.Position); //Turn towards the camera

Some of the tasks are temporary and get executed once or accept a time parameter (in milliseconds). Others are persistent, meaning they will keep being executed until the task is actively stopped. To stop all tasks you can use the ClearAllImmediately() command:

Game.Player.Character.Task.ClearAllImmediately();


TASK SEQUENCES

You can create a sequence of multiple tasks by using TaskSequence and the PerformSequence function. Create a new TaskSequence with a custom name, add tasks to it with AddTask, close the sequence with Close and then call Task.PerformSequence to perform the sequence.

TaskSequence mySeq = new TaskSequence();
mySeq.AddTask.Jump();
mySeq.AddTask.HandsUp(3000);
mySeq.Close();  
Game.Player.Character.Task.PerformSequence(mySeq);