Unity Editor version 2022 or later.
Install Netick 2 before installing this package. https://github.com/NetickNetworking/NetickForUnity
- Open the Unity Package Manager by navigating to Window > Package Manager along the top bar.
- Click the plus icon.
- Select Add package from git URL
- Enter https://github.com/karrarrahim/UnityTransport-Netick.git
- You can then create an instance by by double clicking in the Assets folder and going
- Create > Netick > Transport > UnityTransportProvider
- UDP
- WebSocket (TCP)
- Relay UDP
- Relay TCP
- WebSocket & UDP
- Allowing players from WebGL and Native device to connect to the server.
Multiple protocols listen port logic
firstProtocol = 7777;
secondProtocol = 7777 + 1;
thirdProtocol = 7777 + 2;
Example:
- UDP Starts on 7777
- WebSocket Starts on 7778
- RelayUDP Starts on 7779
- Websocket Secure (TLS)
- Secure UDP (DTLS)
- To enable Relay for UTP, add
RELAY_SDK_INSTALLED
to scripting define symbols, and ensure Relay SDK has been installed
- Before Launching netick, make sure to use
CreateAllocation
andGetJoinCode
for Host and supply to theAllocation
variable.
- Client needs to call
JoinAllocationAsync
and supply it to the public variable.