Reference to Actor

Hello.

I created two progres bars.
One for PiratShip and second for EnemyShip.
PiratShip is C++ code GameMode and progress bar in blueprint working very good - this is my blueprint:

But i have problem with second EnemyShip blueprint.
Enemy ship is C++ code Actor and progress bar for this one do not work ( no matter what i past as a object)
This is my blueprint for EnemyShip - progress bar:

I have no idea what i should connect as an object.
Could you help me please ?

You need to pass an instance to your EnemyShip actor that is spawned in the world as a parameter to “Cast To EnemyShip” . Or you can update your EnemyShip Actor so it stores a copy of it’s Current and Starting Hull Durability in the GameState and replicate that to each GameState on the client. That way each client UMG widget can get an instance of the GameState and grab the information it needs.

Where is GetYourShipHullProgressBarPercent called from, the blueprint UMG (hud) Widgets?

Are you treating your GameMode like an actor itself where you can actually damage it and destroy it?

I would advise against getting the CurrentHullDurability and MaxHullDurability from the game mode directly. GameMode is only ever going to be available (non-NULL) on the Authority server. This means when you try to play multiplayer you will have issues because your client machines will not have a GameMode returned to them, instead they will be given NULL. Store that information in the Authority’s version of GameState or PlayerController and replicate it to each client as a variable.

Thank you for your help and sugestions.
I gonna try to move it to GameState and I will se how it works.

Thank You.

Did you get this solution working for you?