There is a special type of prefab that can be placed directly in the levels to create wandering enemies.

These are enemies that trigger a battle when they enter in contact with the player.

To create a wandering enemy, simply drag and drop the WanderingEnemy prefab on your scene. Ideally, create a prefab variant so you can tweak the visuals and reuse it.

Place around your level multiple instances of the prefab Waypoint. This indicates your player where to go.

Finally, assign the waypoints on the Waypoints list of the ActorStateWandering component.

image.png

Inside the WanderingEnemy, the battle triggered can be tweaked on the PlayerTrigger object by replacing the BattleSetup (more info about BattleSetups here Battle Setups)

image.png