So I’ve been working to try and recreate the settings for a mmorpg type game to learn how things work. I’m getting through most of the core code but I’m stuck getting selected targets health bars to update when they take damage.
My idea had been that when a player selects something, that something stores the player in an array of things selecting itself. Then what that something takes damage it calls a for each loop and updates everyone that’s selecting it.
So from the picture below, when a player left clicks on a target, the player calls the ‘OnSelected’ interface function and passes himself as the selector and the target as the selected. The green portion gets the player controller and creates the selected character widget, that all works fine. The issue starts from the AddtoArray event that is just supposed to add the selector to the selected target’s array. The event only seems to work when the player selects himself and nothing happens when a player selects an enemy or another player.
I also have the ActorsSelectingSelf array set to repNotify to print the array whenever a change is made. (which seems to be in working order)
If anyone has any ideas as to what is going wrong or another way to update the selected targets health bar whenever they take damage I’d love to hear it! Thanks in advance!