- Home /
How to set object as child to communicate over Photon?
I'm working on a click to pickup system. When a player picks something up, it doesn't communicate the new parent to the other players.
pickableObject.GetComponentInChildren<Controller>().intheGrasp = true;
pickableObject.transform.parent = handleContents.transform;
pickableObject.transform.position = handleContents.transform.position;
I assumed that pickableObject would broadcast its new location and relationship, because it has a PhotonView onboard, but not so much.
Is there a Photon notion of parent?
Thanks in advance!
Answer by Captain_Pineapple · May 20, 2018 at 11:42 PM
Hey there,
i'm no expert with photonviews but:
As far as i know you have to explicetly tell the photonview which components are to be updated, like position rotation and so on. This is something that is mostly broadcasted every frame/change to all users. When it comes to parenting you probably only want to send all the changes once.
So what you could do is to implement a rpc call on the photonview which tells the pickableObject which player picked the object. If you are not familiar with rpc-calls you should check out this basic tutorial page provided by photon.
If you have questions regarding that feel free to ask.
RaiseEvent might be the winner! I'll report back after I try it
Your answer
Follow this Question
Related Questions
Photon unity trying to control two different player cameras over the network 0 Answers
PUN : RPCs or Stream? How reliable are RPCs? 1 Answer
Photon Networking 1 Answer
error spawning player says I'm not connected when photon connects and puts me in a room 0 Answers
How to modify enemy players meshs with Photon Unity Networking? 1 Answer