For the player and for the enemies I want to control how many sprites/prefabs are on screen visible to the player, and when to show or hide them.

We have 4 characters in the player group and 4 enemies.

On screen I want the 4 enemies to be visible.

But for the player group only one character needs to be visible and only when this character turn comes up. Then once he attacks or do other stuff, I want to hide this character and show the next player character.

When the enemy turns comes up, I want to do the followings.

First, the next player character that is in the queue after the enemies move, will be visible.

Then, if the AI will attacks a different player character than the one visible, I want that player character to become visible, replacing the one on screen, then after some defend animation will get hidden back.

I'm assuming this needs to be done in the schematics but I'm lost on how to initialize everything for the battle then chose what is visible on screen or not.

Maybe there is a tutorial somewhere

TLDR: How can I hide/show characters during battle scene?
  • There are turn start/end schematics for that - you can set them up for all combatants in the general settings (Combatants > Combatants > General Settings) or for individual combatants. It's in the Base Settings > (Default) Schematic Settings.

    Should be pretty easy to do - set up 2 actors:
    - type Allies (Battle) and allied to Machine Object
    - type Enemies (Battle) and enemies of Machine Object

    Now, you just have to hide the allies, show the enemies and the machine object (will probably get hidden with the allies). Alternatively, you can also move them off screen instead of hiding them visually (e.g. disabling renderer).
    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!
  • Ok I've found them, so this could work by creating separate turn start end and the rest schematics.

    I think I can move the ally characters offscreen and animate them in and out. even better

    but

    what is this Machine Object thing?
  • Generally speaking, the Machine Object of a schematic is the object the machine runs on. The Starting Object is the object that started the machine.
    E.g. using an Interaction Machine to start a dialogue with an NPC, the NPC (with the machine component) is the Machine Object and the player the Starting Object.

    For the turn start/end schematics, both are the combatant the schematic is used for. So, your actors will define the allies and enemies of the combatant who's turn starts or ends.

    Or, in schematics animating your battle actions, the Machine Object is the user of the action (ability, item, etc.), the Starting Object the targets.
    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.