Hello all,
I am moving onto my battle tutorial and following this tutorial series on a turn based combat system. I am on the target selecting and attack command part, but am attempting to do something a little bit different from the tutorial by making it so instead of a target list, you can click a widget to do your attack. However, when you click the button to do the attack, my enemy character does the animation that my party character is supposed to do.
I have 6 BPs for my characters, a unit base, two children of that BP called “party unit base” and “enemy unit base”, then a child of the party unit base which is my party member, and a child of the enemy unit base which is the enemy.
I believe this problem stems from the fact that when I click the basic attack button, I cast to the battlePlayerController and call a function called EnterTargetingMode which casts to the game mode, then calls a function within my EnemyUnit Base to show the visibility of the widget component. I believe this is at some point changing the unit character variable to be my enemy. I have tried setting the unit character during my combat components start turn function, and cannot figure out how else I might change it back to the party unit after the target button is clicked.
Screenshots and the tutorial are provided, and any help is appreciated! I am a lot less of a developer and more of an artist attempting to make videogames in my free time, so a lot of UE5 is very new to me. If you need any more information or screenshots I’ll be happy to provide.





