This repo is a comprehensive repository designed to help users quickly and effectively get started with Unity's multiplayer solutions using Facepunch as the transport layer and Unity's Netcode For GameObjects framework.
Netcode supports the following versions:
- Unity 2021.3 and later
- Mono and IL2CPP Scripting Backends
Netcode supports the following platforms:
- Windows, macOS, and Linux
- iOS and Android
- XR platforms running on Windows, Android, and iOS operating systems
You can read more about Unity Multiplayer Networking docs here.
If you haven't install Unity Netcode For GameObjects, then do so via this link.
Then install Facepunch Transport layer.
Or copy this git command and paste in Package Manager:
https://github.com/Unity-Technologies/multiplayer-community-contributions.git?path=/Transports/com.community.netcode.transport.facepunch
Then you have wiki page for API and more documentation code.
You need to assign SteamId to FacepunchTransport
private void HandleTransport(SteamId id)
{
// Lorem Ipsum
NetworkManager.Singleton.GetComponent<FacepunchTransport>().targetSteamId = id;
}
By using callback from steam, you can send that information to FacepunchTransport
private void Start()
{
SteamFriends.OnGameLobbyJoinRequested += OnGameLobbyJoinRequested; // Add the callback
}
private void OnDestroy()
{
SteamFriends.OnGameLobbyJoinRequested -= OnGameLobbyJoinRequested; // Remove the callback
}
private void OnGameLobbyJoinRequested(Lobby lobby, SteamId id)
{
HandleTransport(id);
}
After you got the callbacks and also changing targetSteamId
in FacepunchTransport
, is pretty much the same stuff with Unity Netcode For GameObjects.
Highly recommend watching DapperDino's playlist over Unity Netcode For GameObjects.
- Multiplayer Community Contributions
- Facepunch Transport for Netcode for GameObjects
- Facepunch Wiki Page
- Steamworks API
- DapperDino's playlist over Unity Netcode For GameObjects
If you have any questions or issue, just write either to my YouTube channel, Email or Twitter DM.