Hi. I want to create a damage system where specific projectiles have a “cooldown” on their ability to hurt specific players. Here is a gfy showing how my game works (don’t think you can embed gfys?):
…except now the boomerang passes through players when it hits them. The problem with this is that the boomerang can hit a player (and then deal damage to them), pass through them and immediately return and deal more damage. While this is okay if the boomerang travels a lot between the two hits, it’s undesirable when the two happen almost one after another. I’ve built this project in Unity before, and what I did was the following:
- When a player is hit, add that player to a dictionay with the key being the player, and the value being the time it was hit
- When another player is hit, check the dictionary to see if the contacted player is a member. If it is, check if the time has elapsed where it’s okay to damage them again
- If the time HAS elapsed, damage the player again and update the time. If not, ignore them
…but there doesn’t seem to be a dictionary structure in Blueprints. There are arrays however, so in theory I could add a player to the array, and then fire off a timer that would remove it after n seconds. SetTimer does this, but I don’t think I could pass an actor to it’s function as a parameter. Is there any way to achieve what I want through Blueprints? My prototype is almost done so I’d ideally not want to switch to C++ at the moment.