@@ -24,12 +24,12 @@ namespace BeardedManStudios.Forge.Networking.Unity
2424 if (Networker != null)
2525 Networker.objectCreated -= CaptureObjects;
2626 }
27-
27+
2828 private void CaptureObjects(NetworkObject obj)
2929 {
3030 if (obj.CreateCode < 0)
3131 return;
32-
32+
3333 >:FOREACH networkObjects:<
3434 >:ELSEIF:< (obj is >:[i]:<NetworkObject)
3535 {
@@ -47,7 +47,7 @@ namespace BeardedManStudios.Forge.Networking.Unity
4747
4848 if (newObj == null)
4949 return;
50-
50+
5151 newObj.Initialize(obj);
5252
5353 if (objectInitialized != null)
@@ -65,21 +65,6 @@ namespace BeardedManStudios.Forge.Networking.Unity
6565 obj.pendingInitialized -= InitializedObject;
6666 }
6767
68- >:FOREACH networkObjects:<
69- [Obsolete("Use Instantiate>:[i]:< instead, its shorter and easier to type out ;)")]
70- public >:[i]:<Behavior Instantiate>:[i]:<NetworkObject(int index = 0, Vector3? position = null, Quaternion? rotation = null, bool sendTransform = true)
71- {
72- var go = Instantiate(>:[i]:<NetworkObject[index]);
73- var netBehavior = go.GetComponent<>:[i]:<Behavior>();
74- var obj = netBehavior.CreateNetworkObject(Networker, index);
75- go.GetComponent<>:[i]:<Behavior>().networkObject = (>:[i]:<NetworkObject)obj;
76-
77- FinalizeInitialization(go, netBehavior, obj, position, rotation, sendTransform);
78-
79- return netBehavior;
80- }
81- >:ENDFOREACH:<
82-
8368 >:FOREACH networkObjects:<
8469 /// <summary>
8570 /// Instantiate an instance of >:[i]:<
@@ -94,6 +79,7 @@ namespace BeardedManStudios.Forge.Networking.Unity
9479 public >:[i]:<Behavior Instantiate>:[i]:<(int index = 0, Vector3? position = null, Quaternion? rotation = null, bool sendTransform = true)
9580 {
9681 var go = Instantiate(>:[i]:<NetworkObject[index]);
82+ go.SetActive(false);
9783 var netBehavior = go.GetComponent<>:[i]:<Behavior>();
9884
9985 NetworkObject obj = null;
@@ -129,7 +115,7 @@ namespace BeardedManStudios.Forge.Networking.Unity
129115 go.GetComponent<>:[i]:<Behavior>().networkObject = (>:[i]:<NetworkObject)obj;
130116
131117 FinalizeInitialization(go, netBehavior, obj, position, rotation, sendTransform);
132-
118+
133119 return netBehavior;
134120 }
135121 >:ENDFOREACH:<
0 commit comments