Skip to lesson
LESSON 17 / 44 · Beginner

Make an enemy patrol

Create a predictable moving obstacle before adding detection or attacks.

Open editor in a new tab ↗

Before you begin

Place an Enemy on a long solid floor.

Build it step by step

  1. Select the enemy and rename it Gate Bug. For a simple route, choose Patrol in its movement settings.

  2. Choose horizontal movement, a modest speed and a route distance that fits on the floor. Keep gravity on for a ground enemy.

  3. Press Play and watch a complete outward-and-return trip. Move the player out of the way while measuring the route.

  4. For the richer controller, save the enemy through Sprite Studio, then select Enable enemy behavior and Configure enemy.

  5. Choose Patrol, then chase. Configure Patrol distance, direction and Pause at each end. Test its movement again before adding attacks.

TRY THIS IDEA

Practical example

A slow guard walking across a doorway gives beginners a visible rhythm to observe before crossing.

Test your work

The patrol stays within the intended area and reverses predictably.

If it does not work

Use either the ordinary patrol setup or the enabled enemy controller deliberately. A Set movement rule can take control away from the enemy controller.

MAKE IT YOUR OWN

Student challenge

Make a second patrol with a different route length, leaving a safe waiting spot between them.

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

Keep exploring