Hi. I’m building a project with c++ in 4.20.
But I’m using a Widget Blueprint to bind a progress bar.
I’ve got a Player Ship class that extends Pawn. And a BP_PlayerShip blueprint is attached to the c++ PlayerShip class.
In the Widget the function is called GetPercennt_0.
I’ve set it up as:
GetPlayerPawn(index 0) -> CastToPlayerShip -> Get Health -> Return Node
But I keep getting the error on the Get Health node:
“This blueprint (self) is not a BaseShip, therefore ’ Target ’ must have a connection.”
I understand the Widget Blueprint isn’t a BaseShip but I thought GetPlayerPawn would get the default player pawn.
I’ve got a class called PlayerShipGameModeBase that extends gamemodebase and this is attached to a blueprint called BP_PlayShipGameModeBase. Wasn’t sure if I have to reference the game mode to get the PlayerShip.