diff --git a/Assets/Mirror/Tests/Common/MirrorTest.cs b/Assets/Mirror/Tests/Common/MirrorTest.cs index db020c3ef..52bfb8edf 100644 --- a/Assets/Mirror/Tests/Common/MirrorTest.cs +++ b/Assets/Mirror/Tests/Common/MirrorTest.cs @@ -84,10 +84,7 @@ protected void CreateNetworkedAndSpawn(out GameObject go, out NetworkIdentity Debug.Assert(NetworkClient.active, "NetworkClient needs to be active before spawning."); Debug.Assert(NetworkServer.active, "NetworkServer needs to be active before spawning."); - go = new GameObject(); - identity = go.AddComponent(); - component = go.AddComponent(); - instantiated.Add(go); + CreateNetworked(out go, out identity, out component); // host mode object needs a connection to server for commands to work identity.connectionToServer = NetworkClient.connection;