Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

Failed to spawn server object, assetid=...

$
0
0
I can't find an answer that works for me for this error. I've spent days and just can't figure it out. I'm trying to make a multiplayer project, and it works to an extent, but when i spawn an object with NetworkServer.Spawn() or .SpawnWithClientAuthority(), i get an error saying "Failed to spawn server object, assetId= netId=2" None of the answers i've found for other people seem to solve the problem. Here's the code i know is relevant: Class 1: public class GUIControl : MonoBehaviour { public virtual void SetupScene () { if (canSpawnPlayer == true) { manager.SpawnPlayer(loadout); } } } Class 2, on my network manager: public class MyManager : NetworkManager { public void SpawnPlayer (Weapons.Loadout lo) { MyControl.SpawnPlayer(lo); } } Class 3, the object spawned automatically by the network manager upon joining, public class MyControl : NetworkBehaviour { public GameObject playerPrefab; void Start () { ClientScene.RegisterPrefab (playerPrefab); } public void SpawnPlayer (Weapons.Loadout lo) { GameObject obj = Instantiate (playerPrefab, Vector3.zero, Quaternion.identity); obj.GetComponent().loadout = lo; NetworkServer.SpawnWithClientAuthority (obj, connectionToClient) } } If anyone knows possible causes for this error, please let me know.

Viewing all articles
Browse latest Browse all 7934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>