playMaker

Author Topic: 2D top view game: Combat system and triggerzone - Need advice  (Read 1438 times)

Sly

  • Full Member
  • ***
  • Posts: 123
Hello everyone,

I need advice for my 2D topview game.
I'm actually making the combat system. I've got some problem to do it. I want to trigger everything inside my weapon's triggerzone/collision for dealing damage only one time per attack.
I explain:

I add a boxcollider to my character weapon (it's a child of my character) and I activate it in the animation (when weapon is in front I activate it and deactivate it at the end of my animation). So when it collide with something with the tag "Enemy" is dealing damage to actor who are inside the box collider.

Problem: it's dealing multiple time to the same actor.

My requirement:
-A character should not make damage multiple time to the same target with the same attack animation.
-If an actor is attacked by two other, it should deal damage two time
-An actor who attack two target in same time should make damage to both of them.

Can I have advice on it? What can you suggest? I was thinking about triggering multiple target in the boxcollider/triggerzone because it should prevent dealing damage multiple time to a same target in the same animation.
I'm waiting your comment and advice :)

PS: I hope my explanation are correct and my english not to bad :)
« Last Edit: June 18, 2014, 09:53:26 AM by Sly »