Okay so instantiating for close range damage was just a bad idea. I went with a much simpler approach of creating a new object with a circle collider in the position of where the flail ball was in my enemies IDLE animation. From there I used an animation curve to move the ball collider position for each frame of the enemies attacking with flail animation. Lesson learned, animation curves rock!
Does the character jump backwards or something when it gets hit? It could be repeatedly entering and exiting the collision area?
Also, maybe declare what happens when the player stays inside the trigger. State that no more can be instantiated maybe?
Or perhaps a cool down, so perhaps make the player invulnerable for a short amount of time before it can take more damage?
I set it so that if the character gets hit by the prefab it destroys the prefab immediately after. The character doesn’t move at all. I will try making a timer on my health script so that he can only take damage once for a given period of time, good idea Mark! Thank you
No bother
Yea, that’s the best way I think. It’s what a lot of games do just to give the player a chance to get away. If you can, make the player flash or something just to communicate to the player that they wont take any damage in that state.
I ended up doing it a different way although I appreciate your help greatly! I created a bool to only have one prefab instantiate!
Here is the script for anybody who might have this problem in the future.