Short time invincibility question...

Hey all, quick question. My actor has three energy bars. The desired effect is to have him blink on and off for one or two seconds when he gets hit. During this time I want him to be momentarily invincible (similar to many other games). Let me show you what i've done and maybe you can tell me what i'm doing wrong- because while it works sometimes- other times he just keeps blinking forever and therefor invincible forever.
- when hit change attribute (integer) "hit or not" to 2 (meaning he's hit)
- when "hit or not" is 2, set timer within actor to FOR 1 second do...
- animate (i have a blink animation set).
- i also have a rule that says that an enemy can only hurt the actor IF the "hit or not" is set to 1.
- i have another timer inside the actor that says AFTER 1 second change attribute "hit or not" to 1 (thus returning him back to normal).

So what am i doing wrong? It works most of the time but other times he gets hit and blinks forever. Obviously its the coding not changing his attribute back to 1. Curious if this may have something to do with the timer and its check box (i forgot the exact wording. Its something like override or follow through to completion, etc.)

Thanks a million!

Comments

  • gamesfuagamesfua Member Posts: 723
    Bumping this one time.
  • slinky1988slinky1988 Member, PRO Posts: 89
    Is the timer that changes it back to normal ('Hit or not' =1) in a rule? e.g if HitOrNot is 2 AFTER 1 sec change HitOrNot to 1.

    Also, have you considered using interpolate to change the actors alpha to 0 and back to 1 again to create a blinking effect?
  • gamesfuagamesfua Member Posts: 723
    Thanks @nas-m the rule is inside the actor. Do you think it should be its own separate rule? I have thought about the interpolate but thought the animation would be easier since it blinks so quick.
Sign In or Register to comment.