OnNetworkInstantiate is never called

Hey !

I’m doing a simple multiplayer client-server game, but I’ve run into a issue where OnNetworkInstantiate is never called.
Here’s my code below for that method, incase I wrote something wrong with it.

void OnNetworkInstantiate(NetworkMessageInfo info)
	{
		Debug.Log("New object instantiated by " + info.sender);
		if(networkView.isMine)
		{ //if I am the owner of this prefab
			Camera.main.transform.GetComponent<SmoothFollow2D>().target = spawnedPlayer.transform;
		}
	}

Thanks for any kind of help ! :slight_smile:

The information you provided is a bit thin. Are you sure you use Network.Instantiate to create that object and that you do this after you have connected successfully? Also make sure that script is attached to the prefab you’re creating