How to use Set Owner Player node
I have 4 floating healthbar widgets for each of the pawns in a splitscreen local multiplayer game.
I am doing this because I need each one to face toward the camera of one of the splitscreen viewport owning players rather than having them all face toward player 0.
I have to set the Owner of each widget component properly so that each player's viewport only sees the Widget component on the enemy tank that is owned by the viewport owner player. Each of the 4 widgets on each pawn has its "Only Owner See" checkbox ticked.
The problem is that I can't seem to find a blueprint node that gets a Local Player Object, but Widget components "Set Owner Player" node only accepts Local Player Object references, not Player Controller references.
I also can't define a variable of type "Local Player Object". The "Set Owner Player" seemed like what I need, but it requires a data type that doesn't appear to exist.
Does anyone know how to get a reference to a given Local Player Object (not Player Controller)?
asked Jan 02 '18 at 12:14 AM in Blueprint Scripting
Hey there, i assume each player has its own player controller. If that is the case when you create the widget you associate a owning controller to it. Then on the UMG widget you can access the controller and the pawn by using Get Owning Player and Get Owning Player Pawn.
answered Jan 02 '18 at 11:48 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here