Problem with collision and life

Hello,

I have an actor with a self attribute that is "life" and the value is 30. I want that when this actor collides with a bullet to do self.life -10 and when is = 0 destroy actor. When I spawn for example every 0.2 sec. a bullet, the life go only to 20 but if I stop to spawn for a bit and then spawn it is now 10 (correct). Here is a video: I want that every bullet collide with my actor, to decrease his lives by 10.

Here is the simple rule:
image

Thanks :)

Comments

  • patapplepatapple Member Posts: 873
    any idea?
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    The rule is probably only going off once because the projectiles are overlapping the actor all the time. Its always true, so it only fires once. (The rule never has time to change back to false.)

    Try placing the collide test within the projectiles and make "life" a game-level attribute.
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    I don't think those rules go together like that. You have a rule inside of a rule that doesn't really need to be like that. You should add that second rule as another condition by clicking the "+" sign over to the right, and add it in. Then have the "change attribute" as the function that happens.
Sign In or Register to comment.