- Home /
Question by
unity_V78ydTicLY_XsQ · Dec 30, 2020 at 11:33 AM ·
instantiateunity 2dphoton
what is the best way to instantiate a gameObject as a child of another gameObject in photon?
here is my code:
void SpawnObject(){
GameObject a = PhotonNetwork.Instantiate("Object", transform.position, transform.rotation, 0);
a.transform.parent = AnotherObject.transform;
}
a.transform.parent = AnotherObject.transform;
only works for the first player that joins the room. is there a way to assign a gameObject to a parent in the PhotonNetwork.Instantiate
function?
Comment
Your answer
Follow this Question
Related Questions
How to add a component to a prefab 1 Answer
How to drag an instantiated UI element? 0 Answers
PUN - Unity 2D Synchroniztion 0 Answers
Canvas not showing 2 Answers
PhotonNetwork.Instantiate() doesn't work 2 Answers