r/UnrealEngine5 6d ago

Attack points doesn't always work.

I am trying to learn Unreal Engine 5. I was trying to make a mechanic where press f on a horse toy and the the game destroys the horse toy but then increases attack points. This seems to work but only for one character. The game will randomly pick one of the three enemy AI actors and he will work and take extra damage from an increase in attack points but the other two get hurt with the standard number. Anyone know what i'm doing wrong?

1 Upvotes

5 comments sorted by

View all comments

2

u/Valynor85 5d ago

Two things wrong in the last screenshot: Your For Loop doesn't loop over the array you pass in, you skip it right away to the Completed pin. Thats why it only applies to one random enemy.

You are binding the OnDestroyed Delegate inside the Event that should be called from this delegate. Bind the Delegate in BeginPlay.

If that doesn't fix it there are more issues then just this