How to limit the movement range of enemy 'random movement'

I added a “Random Movement” template movement action to my enemy for patrolling.

However, this patrol moves randomly across the entire map. I need to restrict its movement to a specific area.

How can I do this? It seems that setting a movement range limit is not possible within the “Random Movement” action.

One way to do this is with invisible tile collisions using a specific layer/mask setup. You could have a transparent tile on a tileset with its collision set to a unique layer. Then on the enemy, set its collision mask to detect that layer. After that, you can map out a region with those invisible tiles where you want the enemy to walk, and it’ll act like walls just for that enemy.

Hopefully that helps!

1 Like

Thanks for the help! Setting up a separate collision layer for transparent tiles solved the issue. Random movement within the area is now implemented.

It would be great if AGM could add a region editor similar to navigate.