*** NEEDS TO BE UPDATED SINCE LAST MERGE - THE BELOW INSTRUCTIONS ARE NO LONGER APPLICABLE. *** *** IF YOU ARE FAMILIAR WITH UNREAL ENGINE, ALL YOU NEED TO DO IS ADD THE MENU SWITCHER TO VIEWPORT AND YOU ARE GOOD TO GO. ***
This Unreal Engine project is the creation of a plugin that enables multiplayer functionality for any Unreal Engine game. The plugin establishes a server connection between players on a map of your choosing. Simply click Host and you can Host a level of your choosing on a listen server.
Check out the Lobby-UI branch for the latest updates on this project where the UI is getting revamped to show a list of lobbies and options for hosting. This new UI will be much more scalable for any project.
If you'd like to utilize this plugin, simply download this repo as a zip. Then all you need to do is copy the Plugins folder over to another Unreal Engine project. Compatible with UE 5.0+ but only specifically tested on UE 5.3 and 5.4.
<---------------------------------------------------------------------------------------------------------------------------------->
Blank Project Tutorial
- Create new Unreal Engine 5 project.
- Create a map for the "Main Menu."
- Create a map for the "Lobby" where you wish to host the server. This will be the map all players travel to when the server is hosted.
- On your Main Menu level, open the Level Blueprint
- Within the level blueprint, add a Create Widget node and select the WBP_Menu widget from the plugin. Attach this to the Begin Play event.
- Within the Menu Setup function, you can set a few parameters.
- Number of Public Connections: Pretty self explanatory. Limits the limit of users in your lobby.
- Type Of Match: Please keep this value to "FreeForAll" as it is hard-coded in the "Join" logic to only join a lobby with the Type Of Match "FreeForAll".
- Lobby Path: Input the path to the level you wish to host the server on. The '/Game' directory is your Content folder. Just lead with '/Game' and replace the rest of the path with the corresponding path beginning
with, but not including, your Content folder. For instance, if you map is in Content/Maps/MyLobbyMap.umap, your value should be '/Game/Maps/MyLobbyMap'.
- Drag the output pin from the Create Widget node and call the "Menu Setup" function on the widget.
- Drag the output pin from the Create Widget node and create a "Add to Viewport" node. Make sure the widget is the target.
- For the "Add to Viewport" node, you must get the Local Player Controller and plug it in to the player controller input pin.
- After adding the widget to viewport, you need to change the player's gamemode to UI Only utilizing the player controller from the previous step.
- Lastly, use the Set Show Mouse Cursor node to show the mouse cursor on the screen so the user can click the Host/Join buttons.