Skip to lesson
LESSON 19 / 44 · Intermediate

Make enemies follow the player

Connect detection to pursuit while keeping obstacles fair.

Open editor in a new tab ↗

Before you begin

Enable enemy behavior and prepare a clear test corridor.

Build it step by step

  1. Open Configure enemy. Choose Wait, then chase or Patrol, then chase according to the desired starting behaviour.

  2. Set Movement speed below the player’s running speed while learning. Use a detection range large enough to observe pursuit.

  3. Keep Ground enemy (gravity) enabled for a floor-based enemy. Turn it off only when you intend an aerial chaser.

  4. Test approaching from both sides. Enable Face the player / travel direction if the artwork should turn toward its target.

  5. Add one wall and one gap separately. Ground enemies do not automatically jump gaps or climb ladders; design their route accordingly.

TRY THIS IDEA

Practical example

A slow ground bug follows the player along a corridor while a separate aerial enemy can chase through open vertical space.

Test your work

The enemy follows the player after detection and does not depend on a timer repeatedly changing its position.

If it does not work

If pursuit stops after a rule, check for Set movement or Move to position actions. Enemy behavior on / off can return control to the controller.

MAKE IT YOUR OWN

Student challenge

Design an escape route where the player uses a ladder the enemy cannot climb.

Show the result to a partner. Explain what you changed and how you tested it.

Keep exploring