Skip to content

Instantly share code, notes, and snippets.

@BrentFarris
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BrentFarris/344d3cf15bfe5eeba24f to your computer and use it in GitHub Desktop.
Save BrentFarris/344d3cf15bfe5eeba24f to your computer and use it in GitHub Desktop.
Forge Networking: Buffered Network Instantiation
using UnityEngine;
using BeardedManStudios.Network;
public class MakePlayer : MonoBehaviour
{
private void Start()
{
if (Networking.PrimarySocket.Connected)
Networking.Instantiate("Guy", NetworkReceivers.AllBuffered);
else
{
Networking.PrimarySocket.connected += delegate()
{
Networking.Instantiate("Guy", NetworkReceivers.AllBuffered);
};
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment