How to delay enemyanimation

I’ve got a script connected to playing the animations that controls the game functions and the turns of my and the enemy characters. but I’ve come across an issue and I’m wondering as to how I can at the very least delay the OnAttackComplete because currently the code runs so fast that the animations of the player character and the enemy character play at the same time.

I’ve tried to use Thread.sleep() but it just pauses both animations before they play and then cuts into them really weirdly like it was playing half way already but no matter what time I set in it, it always jumps to it about half way through I’ve tried using Thread.sleep() on both of the animation calls or just one of them but the outcome is the same.

I’ve tried only calling OnAttackComplete after an animation has been completed by setting it to an if statement for when a bool has been set to true after an animation event has passed but that didn’t work out.

for some context I’m using a script to clone a prefab object so that I can have one player and enemy that share similar functions. all I need is some way to delay the animations from happening OR the onAttackComplete from reading before the animation has been completed. (ignore the green line)

I believe you’re supposed to use events for this sort of thing, but you could also use something like this:

Invoke("onAttackComplete",3);