Set Direction Random


Description

This action is used to set the movement direction of the instance to one or more random directions chosen from the 8 cardinal points. You can click one or more of the 8 directional arrows within the action and the action will choose one of them at random to use as the direction for the instance. If you select none of the arrows then the action will have no effect on the current direction of the instance.


Action Syntax:

Set Direction Random Syntax


Example:

Set Direction Random Example
The above action block code generates a random value between 0 and 10 and stores it in a temporary (local) variable. This variable is then checked and if it is greater than five then one set of random directions is chosen and if it is less than 5 then another set is chosen.