Create Player Controlled Unit

Options
Hey there :) Im creating a game with multiple rounds, so I decided to have a Player Object that does not get destroyed on roomchange and a "Ship" object that gets created when a new round starts. I only worked with "PhotonNetwork.Instantiate" until now but I want the created ship object to be a child of the Player object to have easy control on upgrades and more. A thread that I found suggested to use rpcs.

This code is my Player object, CreateShip gets called from a GameManager Object as soon as the game starts:

public void CreateShip()
{
if(photonView.isMine)
{
CmdShipSpawn();
}
}

[PunRPC]
void CmdShipSpawn()
{
int xSpawn = Random.Range(-20, 20);
int zSpawn = Random.Range(-20, 20);
Debug.Log("Spawn Method called");
var myNewShip = Instantiate(playerShip, new Vector3(xSpawn, 1f, zSpawn), Quaternion.identity);
myNewShip.transform.parent = gameObject.transform;
}

Now I struggle to give the player ownership of created ships, they are created as scene objects.

So I need
1) A way to parent ship objects instantiated with PhotonNetwork.Instantiate to the corresponding player object
OR
2) A way to give ownership with the RPC-Call

Thanks for helping :)


After changing random stuff around the parenting works now :)