Hurt the main actor (collision)

igpxnaruto4igpxnaruto4 Member Posts: 81
edited January 2012 in Working with GS (Mac)
**** i have to rewrite this cuz i didn't copy it and i had to log in!!!
Well here goes i have a 2 actors a zombie and a human, the human has a variable that is set to 100 and when the zombie collides with the human it -25 health. i also added the collision behavior to the zombie. the problem is that when the zombie hits the human, the human dies to fast because it keeps following and colliding. so i also tried a timer under the -25 health rule which is set to 1 second, the problem with that is that the zombie had to be touching with the human for 1 second but since i added a collision behavior it bounces. what i actually want is that when the zombie touches the human it can't affect it for another 1 second.
Any idea?
Thanks!

Comments

  • OkyshoOkysho Member Posts: 158
    I had a similar issue in my platformer. Try this.

    Create a boolean in your human call in "invul" or "invulnerable" or something like that. Every time the zombie hits the human, create a rule. If the player's invul is false and you collide with the zombie, take down your numbers as usual, then set the invul to true. Separate from this, create a time for every 2-3 seconds set invul to false.

    This works for me best, but there's a bit of a snag in that you can't really time it exactly.
Sign In or Register to comment.