Hello everyone, I've been reading the forum for a while, but this is my first post. How can we build a protective shield feature for our game? The goal is to have invincibility that is not time limited, but hit limited. The character would activate the shield, it would stay active as long as the character doesn't get a hit. When the character is hit, the shield would break. The second hit would kill the character. Thanks!
Hi, welcome to the forum! Add a Heath component to the character and set health to 2. Then trick is that the character's Default Animation is the character with a shield on it, and then the Damage Animation on the Health component would be the normal character sprite with animation speed 0. So when your character gets first hit its health reduces from 2 to 1 and at the same time sprite changes to shield lowered, then at next hit your character dies...
Thanks @trudnai ! In this case the character would always start with shield active. We can add an enemy with 1 damage to every first scene to make the character lose the shield before starting the level. But we're trying to make the shield a power up that can be purchased with in game currency. I couldn't find an action that would increase the health of the character that might be used to activate the shield for in game currency. Am I missing it?
I see, then you need to do the powerup with an Action. The Action has an Action Animation which you can choose to have that Character Overlay, and on that you can add a Character Bullet object as a shield.
Thanks a lot @trudnai ! I've been trying implementing your idea for few hours, the problem is: Bullet won't kill the enemy unless it has spawner. When it has a spawner, it just stays where it is spawned and won't follow the character. I'm attaching two zipped bbdocs that shows the shield and spawner behavior. How can we make the spawned object follow the character, or any other workaround ideas?
Hello, I have exactly the same problem. Is there any workaround for this problem? Or other ideas to build a shild witch follows the char and absorb all enemy bullets (not invincibility)?
hello i am use also shield but there is problem in character onces shield is active then character touch enemy so character moves not a stable there position