Skip to content
Documentation

Navigation and Pathfinding

Use Navigate To Point to walk an Object around a wall. Use Chase Object when the destination is a moving character. Both Actions steer by velocity and work in 2D and 3D Scenes.

Prerequisites

Prepare a moving Object, its Logic attachment, and a Scene with a clear floor or movement area. Give the moving Object appropriate collision geometry. For a top-down 2D test, use zero gravity and leave the moving body unfixed. Add one solid Fixed wall or a strip of solid tiles with space to go around it.

Save a checkpoint and choose a destination within the initial movement area. World distances use metres, speed uses metres per second, and Re-plan Every and Pause Navigation use seconds.

Walk Around a Wall

  1. Attach a Logic Component to the moving Object and add a Create Event.
  2. Add Navigate To Point from Movement and Physics > Navigation. Keep Applies To on SELF.
  3. Choose a point on the far side of the wall. Set Speed to 2, Stop Distance to 0.2, and keep Avoid Others enabled for the initial test.
  4. Add a Navigation Arrived Event with visible feedback, such as changing a Text value or playing a short Sound. Add a different response to Navigation Blocked.
  5. Run from a fresh start. Compare a route with the wall present and one with the wall removed.

Expected result: the Object takes a route around the wall, stops near the point, and reports Navigation Arrived. Closing the passage should produce Navigation Blocked rather than the successful feedback.

Navigation assigns velocity during its update. Another Every Step movement Action can replace that velocity. Inspect competing movement Logic before changing the route or speed.

Choose an Operation

Operation Use
Navigate To Point One destination. It stops after arrival or a blocked walk.
Chase Object The nearest live instance of the chosen Object. It updates its route as the target moves and follows again after the target leaves Stop Distance.
Stop Navigation Cancels the walk and clears its velocity.
Pause Navigation Temporarily lets other gameplay control velocity, then resumes the same walk.
Check Path Exists Produces a Boolean route check for the acting instance and point. Use its typed result in a condition.

Check Path Exists describes the current route model. A later obstacle or target change can still block a walk. Listen for the runtime Events as well.

Follow a Target

Add Chase Object once when pursuit should begin. Choose the intended target Object, set Speed 2, Stop Distance 0.5, and Re-plan Every 0.5 for a small initial test. With several target instances, the Action chooses the nearest instance; check that this selection fits your mechanic.

Move the target around the wall, then back into an open area. The walker should update its route and hold position within Stop Distance. With Stop Distance 0, pursuit stops when the two bodies touch. A larger value can keep an enemy outside contact range.

Avoid Others separates navigating instances. A walker held back by other walkers already at the destination can report arrival as close as the crowd allows. Design attack or interaction Logic around the actual range it needs instead of assuming every arrival is the exact center of the target.

Handle Arrival and Blockage

Navigation Arrived runs on the walking instance after point arrival or reaching the chase distance. A chase can continue when its target moves away again.

Navigation Blocked runs when no route is available, there is nothing to chase, or the walker remains stuck. Navigate To Point stops; Chase Object keeps trying. Choose Stop Navigation if your blocked response should abandon pursuit, or request another point for a patrol.

Use a discrete event or a timer for retry decisions. Starting the same Action on every frame can continually replace the current walk and obscure its completion.

Allow Knockback

When a hit sets the walker’s velocity away from an attacker, add Pause Navigation for a short interval such as 0.2 seconds. During that pause, navigation releases control of velocity. It resumes the route afterward.

Test a hit while approaching, while waiting near the destination, and while changing targets. Use Stop Navigation for a permanent cancellation; a pause retains the walk.

Check Obstacles and 3D Ground

The 2D route model uses solid tiles and solid Fixed Objects; one-way tiles don’t close the navigation grid. Moving bodies still participate in ordinary collision, but they aren’t all permanent walls in the route model. Avoid Others concerns other navigating instances.

In 3D, navigation uses the Scene’s walkable field where available, including ground, block tops, and supported Primitive geometry. Fixed solid Objects add obstacles. Check height changes and passage width with the actual mover. X and Y describe the ground plane; Z is world height.

The current development driver can finish a straight segment to a destination outside its planning grid. Space outside that grid has no known route obstacles. Keep the first test within modeled space, then check off-grid destinations against the real level and collision.

Saved navigation settings can resume a walk after loading; the route is planned again. Test restoration with changed obstacles rather than assuming the old path remains valid.

Troubleshooting

Symptom Check
The Object doesn’t move Confirm the Event, SELF target, nonzero speed, unfixed body, and absence of competing movement.
A route goes through a visual wall Check the wall’s solid and Fixed settings or tile collision, rather than its picture alone.
The Object is stuck in a narrow passage Compare passage width with the mover’s collider and radius.
Pursuit follows a different character Check how many live instances use the selected target Object.
Knockback disappears immediately Pause Navigation while the hit controls velocity.
Blocked feedback repeats during pursuit Choose whether Chase Object should keep trying or Stop Navigation should cancel it.
Arrival occurs short of a crowded goal Check Stop Distance and Avoid Others before requiring an exact position.

Myth Engine Documentation