【UE5 Multiplayer Online Tutorial】04-Join the game

Effect

step

1. Create a new control blueprint, the parent class is "USC_Button_Standard" 

The control blueprint is named "UMG_Item_Room", which is used to represent the interface of each searched room

Open "UMG_Item_Room", create a new variable in the diagram and name it "Session"

 Variable type is "Blueprint Session Result", select Editable Instance and Expose at Build

2. Open "UMG_MainMenu" and add a click event for searching games

Add the following nodes

 

 3. Set the number of players to 2

 4. Set the multiplayer viewport size in the editor preferences

 At this time, the effect is as follows, but the room cannot be joined yet:

When the user clicks the room button, continue to execute the following nodes:

 The final running effect is shown at the beginning of the article.

Guess you like

Origin blog.csdn.net/ChaoChao66666/article/details/131925008