Multiple Collision Detection Issue[solved]

poehyrulian

  • Posts: 78
So in my zombie game I have my zombies HP set to 15 and my machete deals in between 3 to 5 each site strike however the zombies die after only one hit. How can I fix that?$

« Last Edit: September 08, 2016, 08:17:30 pm by poehyrulian »

JeffreyDriver

  • Posts: 2262
Can you post your code?

I'd guess though that the collision is being detected repeatedly. Use a boolean to make sure that the collision only happens once per attack.

poehyrulian

  • Posts: 78
So a collision boolean that sets itself to false after the collision is detected... I can post code later but I'm not at my house right now.

xplosion28

  • Posts: 275
Exactly, then change the boolean back to true after a certain amount of time.  Pretty much giving the zombie an invulnerability to attacks for that short duration.

poehyrulian

  • Posts: 78
Alright yo Thank you for the Boolean advice cause it was a futha muckin charm. here is the block

poehyrulian

  • Posts: 78
BTW the if health equals zero block doesn't work if health is taken below zero... so in order for it to work best that must be changed to if health is less than or equal to 0.