Player spawn under background

Hello

Here's my scene structure:


I have a Canvas with an Image component which is my background and a 2D GameObject as spawnpoint.

I instantiate on the network with my Manager script but the object appears under the background image:

void Start()

  {

    PhotonNetwork.Instantiate(Caleche.name, spawnPosition.transform.position, Quaternion.identity);

  }

What am I doing wrong?

PS: my player prefab has ViewId. It is referenced in the script as well as the spawnpoint.

Thanks

Answers

  • Hi, this happened to me too. I solved it by adding this in the Awake function of my player

    transform.SetParent(GameObject.Find("Canvas").GetComponent<Transform>(), false);

  • Hi CertraX

    I also find a workaround by sending an RPC call to all to set the parent (for all my networked objects).

    However, all the tutos I've watched don't need to do this.

    That's what I try to understand.