Set Direction Random Icon Set Direction Random

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 Action

Example:

Set Direction Random ExampleThe above action block code chooses either true or false and stores the result in a temporary (local) variable. This variable is then checked and if it is true then one set of random directions is chosen and if it false then another set is chosen.