Multi-humanoid debounce question

I have a large blade, and I’m a bit of a loss here.

My goal here is when the blade hits a humanoid it will damage them, but I don’t want it to damage the humanoid more than once while the blade is swinging through them.

This is easily done by setting up a debounce, but my issue here is that there can be crowds of humanoids, and with a debounce the blade will only be able to deal damage to one of those many humanoids with one swing.

How would I set up a debounce to be able to damage multiple humanoids at the same time?

1 Like

You can make a list of all humanoids hit. If the humanoid isn’t in the list, add them to the list and damage them

1 Like

Could you create some type of table that stores the names of the characters/users that it damages so that when it damages rather then only damaging one person you check the table to see if the user is on a CD or not.

A table-based debounce should do the trick(or dictionary). Same thing as a regular debounce, except each index contains the humanoid it hit before. Then you would let the asynchronous action toggle the debounce. :stuck_out_tongue:

2 Likes

I’d go for an attribute based system so that no matter what the source of the damage is, the humanoid still won’t be damaged until the debounce is over.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.