[UE5 Multiplayer Online Tutorial] 03-Create a Game

Effect

step

Open "UMG_MainMenu" and add a click event for the button to create a room

 Add the following nodes

 Among them, "FUNL Fast Create Widget" is the function node that comes with the plug-in, and the content is as follows:

 The "Create Session" node means that after the game successfully creates a session, other instances of the game can be discovered (using the  Find Session  node) and joined (using  the Join Session  node). On this node it is possible to specify the number of players allowed in a session and whether the session can be created in LAN mode. For supported online subsystem modules, setting LAN mode to false will attempt to create an online game. (Official document address:https://docs.unrealengine.com/4.26/zh-CN/ProgrammingAndScripting/Blueprints/UserGuide/OnlineNodes/#:~:text=%E5%88%9B%E5%BB%BA%E4%BC%9A%E8%AF%9D%20%E9%A6%96%E5%85%88%E4%BB%8E%20Create%20Session%20%E8%8A%82%E7%82%B9%E5%BC%80%E5%A7%8B%E3%80%82%20%E6%B8%B8%E6%88%8F%E6%88%90%E5%8A%9F%E5%88%9B%E5%BB%BA%E4%B8%80%E4%B8%AA%E4%BC%9A%E8%AF%9D%E5%90%8E%EF%BC%8C%E6%B8%B8%E6%88%8F%E7%9A%84%E5%85%B6%E4%BB%96%E5%AE%9E%E4%BE%8B%E5%8D%B3%E5%8F%AF%E5%8F%91%E7%8E%B0%EF%BC%88%E4%BD%BF%E7%94%A8%20Find,Session%20%E8%8A%82%E7%82%B9%EF%BC%89%E5%B9%B6%E5%8A%A0%E5%85%A5%EF%BC%88%E4%BD%BF%E7%94%A8%20Join%20Session%20%E8%8A%82%E7%82%B9%EF%BC%89%E3 %80%82%20%E5%9C%A8%E6%AD%A4%E8%8A%82%E7%82%B9%E4%B8%8A%E5%8F%AF%E6%8C%87%E5%AE%9A%E4%BC%9A%E8%AF%9D%E4%B8%AD%E5%85%81%E8%AE%B8%E 7%9A%84%E7%8E%A9%E5%AE%B6%E6%95%B0%E9%87%8F%EF%BC%8C%E4%BB%A5%E5%8F%8A%E6%98%AF%E5%90%A6%E5%8F%AF%E5%9C%A8%20LAN%20%E6%A8%A1%E5%BC% 8F%E4%B8%AD%E5%88%9B%E5%BB%BA%E4%BC%9A%E8%AF%9D%E3%80%82

Cancel the logic to display UMG set in the player controller

 Add logic to display UMG in the level blueprint of the map "Map_MainMenu"

 Set the default Pawn class to "BP_ThirdPersonCharacter"

 

Guess you like

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