Using a UMG button to select a character

You have to set up your controller to possess the character you want. To talk to your controller bp from UMG, I would suggest using a BP interface. Create an interface and add it to your controller. You need to set up one function and set a varible you are going to use determine which character to select. I used an int since it is easy to work with an array.

Next, Create a variable in you Controller to hold the character variables. Also, set up the event from the interface to change possession.

I quickly dragged and dropped four players in the world and referenced them in the to the level bp, created an array, and sent it to the controller. I also created and added my widget to the viewport here. I would not do this stuff here in an actual game.

Finally, I created my widget with four buttons to select each character. I sent a message to the Controller interface with the int I wanted for each character.

Actually, the last thing I did was test it.

It worked!

-James