Move (script event)

Game class

This event operates on an instance of the game class type {{{gameclass}}}

Description

This event causes an entity to move a certain distance along a desired direction.

Usage

void move( constant angle , integer distance )

Parameters

  • [angle] - The direction the entity will move from the following:
UP
DOWN
LEFT
RIGHT
FORWARD
BACK
REL_UP
REL_DOWN
REL_LEFT
REL_RIGHT
REL_FORWARD
REL_BACK
EAST
NORTH
WEST
SOUTH
  • [distance] - The amount of space to travel in game units.

Examples

move upwards 20 units

$my_entity.move( UP, 20 );

Notes

This event is intended to move an entity along one of six principal directions in either world space or local space.

You can pass an arbitrary number to the script event but you’ll find that it only affords you control over the heading. Vertical movement is restricted to either up or down with the exception of relative parameters, where direction is relative to the orientation of the entity.

That said, you could rotate your entity to face the intended path of travel you could tell it to move forward and it would work as intended. This can prove to be tedious however and alternative script events like moveTo or moveToPos may be more suitable.

Note that distance can be a positive or negative value; something like ( WEST, -20 ) will actually result in movement 20 units to the East.