Skip to content

Instantly share code, notes, and snippets.

@BrentFarris
Last active August 29, 2015 14:13
Show Gist options
  • Save BrentFarris/91b938ae4c17dc9e5194 to your computer and use it in GitHub Desktop.
Save BrentFarris/91b938ae4c17dc9e5194 to your computer and use it in GitHub Desktop.
Connect to a Server With Forge Networking
using UnityEngine;
using BeardedManStudios.Network;
public class StartServer : MonoBehaviour
{
public string host = "127.0.0.1"; // IP address
public ushort port = 15937; // Port number
public Networking.TransportationProtocolType protocolType = Networking.TransportationProtocolType.UDP; // Communication method
private void Start()
{
Networking.Connect(host, port, protocolType);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment