[Solved] Cover system for my side scrolling shooter

I want to make my side scrolling shooter character taking cover behind a sprite object by holding F key so the character won’t get shot and instead the bullet fired by the enemy, hit the cover.

You need a ‘take cover’- animation that is triggered to play by pressing F. So what is exactly the problem you have?

The problem is, the character’s animation is just a single sprite (not animated). I want to have a condition where, holding F key behind a “cover”, change the opacity of the player character to be darker, so bullet won’t hit the character and instead, hit the cover.

So you want the bullets to ignore collision with cover if the ‘F’ key isn’t pressed, but to act on collision if the ‘F’ is pressed? Build that into an event.

1 Like

Yes, that’s it. But I’m not sure how to make it work. Can you help?

Something simple like this :

Man, how could I not thought of that. Thanks, MrMen.