Edit - rewriting this as initially wasn’t clear.
When a client connects to the server, I want to spawn an object and assign that client authority over that object.
using the following code:
[Command]
public void CmdSpawnBase()
{
GameObject myBase = (GameObject)Instantiate(m_baseList[Player.g_connectedPlayers.Count - 1]);
myBase.transform.parent = SceneManager.Instance.m_sceneList[1].transform;
NetworkServer.SpawnWithClientAuthority(myBase,gameObject);
}
This results in everything going as expected on the host, the objects spawn, are assigned to the parent and have appropriate authority set. However, while the remote client can see the objects, they do not have authority set and have not had their parent transform set. I’m hoping I’m missing something really obvious here but i’ve been tearing my hair out over getting these objects to behave as wanted for ages.
Really struggling with this -_- any and all help is appreciated.