Hi, I want to implementate a key to make my character to defend himself avoiding taking damage of enemies. But I have a problem, I don't know a couple of things for doing it:
Hope you could help me. Thanks
You can check out this in the script reference:
You will notice that GetButtonDown will return true when the button is pressed. So, you could use this function to set a boolean flag (you could call it AFF_INVULNERABLE), and you could un-set the flag using GetButtonUp. Then put an IF check in your script that handles applying damage to the player (If that flag is set, then don't apply the damage).
answered May 16 '11 at 05:04 PM