Help with making a shield

Hi. I just wanted to know if anyone knew a way that i could make my character activate a shield once a key is pressed and deactivate it once the key is let go off. to be more specific i need help with making the shield work, i already have a shield sprite and a mechanism that uses the attacher behavior, once the player is able to use the shield, to attach the shield to the player. though for some reason the enemies still do go through the shield, I’ve tried many different methods but none of them work.

Here’s a link to my game: http://www.flowlab.io/game/play/1131873

Ok do this:
Set the repeater to a key press block to 0. Then make an always block connected to the in side of a switch. The ON button on the keypress is connected to the ON on the switch, same with OFF. Then attach the out side of the switch to an emit block that emits a shield. Then celebrate and throw your shield at captain america amd decapitate him.

Dont forget at the end to put the up output from the keyboard trigger into the off input of the switch. And @meburningslime there is not on or off of the keyboard.

Oh, you know what i mean :lol: .

@meburningslime yep lol

@meburningslime Sorry I forgot to thank you! Thanks a lot this really helped!

Ots fine. Balance Restored! :lol: