Hi. Executing the code below on the host side works fine (mCume != null), however, on the client side it always ends with mCume = null. Am i missing something?
public GameObject cubePrefab;
public GameObject mCume;
void Update()
{
if (isLocalPlayer)
{
CmdSpawnCube();
}
}
[Command]
void CmdSpawnCube()
{
mCume = (GameObject)Instantiate(cubePrefab);
NetworkServer.Spawn(mCume);
}
Thank you!