Hey,

After following the 2D tutorial I decided that I don't actually want to make multiple different battle scenes and instead I'd like them to happen in the original scene.

I got that working quite easily, but the problem is all the enemies are still moving around in the world while the battle is happening.

So is it possible to pause everything that's NOT happening in the battle? So enemies moving around with Move AI mostly.
  • There's a TimeScale setting that can be set to 0 to freeze everything, that may work (though I dunno how to set that only for the overworld and not the characters inside the battle) can be used in a schematic by using the Change TimeScale node

    Additionally I see there's a Block Move Ai node that you can use in the start battle schematic. I've not used it, but the tooltip sounds like it could work.
    Block Move AI: Blocks or unblocks the move AI either completely or for a selected object.
    Combatants can't use the move AI while it's blocked.
  • The battle system you're using has options for allowing move AI or not - if you don't want enemies to wander around, don't allow the move AI to be used during battle.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • gamingislove said:
    The battle system you're using has options for allowing move AI or not - if you don't want enemies to wander around, don't allow the move AI to be used during battle.
    Hmm, that's not what I mean, the move AI is already disabled in the battle system. The enemies participating in the battle are not moving.

    What I want to disable is all the enemies that are wandering around outside the battle.

    This is what I have currently:
    1. Enemies spawn in the scene using combatant spawner
    2. They start wandering around randomly
    3. If they spot the player the hunt AI kicks in and they chase the player
    4. When they touch the player a battle starts
    5. All the other enemies are still wandering around while the battle is happening

    I think what would be even better is if there's some way to completely hide the enemies not in battle.
  • If Allow Move AI is disabled in your battle system's settings, no combatants can use the move AI during battle - both in and out of battle.
    Did a quick test to make sure that's the case and worked fine on my end.

    The spawned combatants have a Move AI component attached that will give you information on it's state. Can Use should be false during battles if they don't allow move AI.
    You can also try using a Block Move AI node in your battle start schematic to completely block move AI and another in your battle end schematics to unblock it again.

    As for hiding all enemies out of battle, that can also be done using schematics in your battle start schematic.
    Use a Select Combatant Objects node to store all combatant game objects (or just all enemies) that are not in battle (i.e. In Battle setting set to No) into a Global data origin selected data. Use a Activate Object node to disable those game objects.
    Global data is used to keep them stored until the end of the battle so you can enable them again in your battle end schematics. So your battle end schematics use an Activate Object node to enable them again.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.