Question by
skywaltzlabs.shikhar · Sep 25, 2015 at 05:27 AM ·
photonparentchildmultiplayer-networking
Parenting over network
I am working on a co-op game using photon unity, I am using parenting to move my object with respect to other, when I am setting my object parents to null one more copy is being created and being left on its parent object or you can say perviously parent object on sometimes on master's or clients or on both screen.
Players are getting Instantiated locally and all code is being synced using RPCs
void OnCollisionStay(Collision Coll)
{
if(Coll.collider.tag == "Plank")
{
transform.parent = Coll.transform;
}
}
void OnCollisionExit(Collision Coll)
{
if(Coll.collider.tag == "Plank")
{
Coll.gameObject.GetComponentInChildren<Animation>().Play();
transform.parent = null;
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612034958im_/https://answers.unity.com/themes/thub/images/avi.jpg)