EnemyAI

EnemyAI houses basic AI functionality, including patrolling left and right, turning on contact with walls or ledges, moving towards another actor, jumping at intervals or on contact with ledges, and attacking at intervals.

Public Methods

Public void FacePlayer()

If GameManager has a Player slotted, this turns the Enemy to face it.

public void OnNewStateAdded(RexState _state)

Used internally when new RexState components are added to the GameObject the EnemyAI is on. This allows EnemyAI to know about those states and interact with them if necessary.

Public Members

public Slots slots

Various base-level things are slotted here, such as the attached RexActor and RexPhysics.

public StartingMovement startingMovement

Governs the direction this actor initially moves and if it will face the player when created. Additionally, “Move in Wave” allows you to set the enemy to move in a sine wave pattern.

public Turn turn

Options for if this actor will turn when it hits walls, the floor, the ceiling, or ledges.

public Jump jump

Options for this actor to jump, including whether it will jump automatically at intervals or whether it will jump upon encountering a ledge.

public MoveTowardsTransform moveTowards

Options allowing this actor to automatically move towards another Transform.

public EnableNearActor enableNearActor

These options let you enable the EnemyAI only when another specified actor is nearby. This feature is enabled by hitting the “Only Enable When Close” box.

public ChangeDirection changeDirection

These options let the enemy change its movement direction after either a set or a random number of frames.

public Attacks attacks

Options for the Attacks this actor will use, including if it will perform the attacks automatically at intervals.