Parent is not set over the server even when RPC'd !!!

Options
Hi,

I see many people have this frustrating issue: Photon-Instantiating object as a child object doesn't work. The child object is only a child obj locally and doesn't follow the player on other peoples screens as a child obj would/should.

Here's a simple example of an instantiation on Start() of an object that is set to be the child of the object with the following script, and it's being RPC'd and sent and received according to the debug log, but nothing spawns :

public PhotonView pv;
//pv is on a parent object

public GameObject blackSmoke1;


void Start () {
if (pv.isMine )
{
pv.RPC("SpawnSmoke1", PhotonTargets.All);
}

[PunRPC]
void SpawnSmoke1()
{
GameObject go = (GameObject)Instantiate(blackSmoke1, transform.position, Quaternion.identity);

go.transform.SetParent(this.transform);
}

Why is nothing being instantiated? I got no errors and it makes zero difference if I use PhotonNetwork.instantiate: still nothing spawns...Why?

And is there an easy way to instantiate objects as children and have them follow the parents transform on all photon Targets??

Comments