Switching actors in game deletes part of UI
Heres my issue. Hopefully, I provide enough info. I have one User Interface providing the health bar of both actors. For cannon 1 I have the health I cast to my character get the health and then for the other progress bar I cast to my tank ,when I am possessing my first cannon I show only the cannons health and not the tanks, then when i possess my tank i show only the tanks health not the cannons. It seems when i possess the tank it chooses not to show the cannons then of course the other way around.
I know im getting the health i need for each actor but for some reason, it wont show the other actors health when i possess another.
asked Nov 24 '18 at 01:03 AM in Blueprint Scripting
your issue is that your trying to get the player character in each case but the player can only be possesing one character at a time. so when you posses the tank you are no longer possesing the cannon so if you get player character and cast to the cannon (picture 1) it will fail since the tank does not inherit from cannon.
your best bet will be to set a reference for each in the widget when the level starts so you wont need to rely on get player character.
answered Nov 24 '18 at 02:26 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here