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?
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).
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I think I can move the ally characters offscreen and animate them in and out. even better
but
what is this Machine Object thing?
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.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!