Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: serenefox on May 10, 2020, 01:57:22 AM

Title: Photon Pun 2 Trying to set parent on all clients for an instantiated gameobject
Post by: serenefox on May 10, 2020, 01:57:22 AM
Hello,

I have been at this all day trying to figure it out.

Here is my problem if anyone can help:

I have a player select screen that saves the player you want to use when picked. Then it loads the game scene and spawns the my character controller. I then have the player mesh that was picked previously network instantiated.

I can't seem to parent the network instantiated player mesh to the network instantiated character controller no matter what I try to do. Is there a workflow for this?

Thanks for any information!
Title: Re: Photon Pun 2 Trying to set parent on all clients for an instantiated gameobject
Post by: serenefox on May 11, 2020, 02:38:34 AM
Ok so I had it working at one point until two clients chose the same mesh then my logic broke. So I went a different route with it and I have solved my problem. I would however still like to know the best way to do this.
Title: Re: Photon Pun 2 Trying to set parent on all clients for an instantiated gameobject
Post by: jeanfabre on May 11, 2020, 03:21:23 AM
Hi,

 you should not parent different network views together, instead one should follow it on late update, or something along that thinking.

when you do this, you should have a different set of network objects, one for the lobby, and one for playing, and they should only communicate via either player properties or room properties. think of them as belonging to do different context, they should not interact with one another directly.

Bye,

 Jean
Title: Re: Photon Pun 2 Trying to set parent on all clients for an instantiated gameobject
Post by: serenefox on May 11, 2020, 10:31:25 AM
Hi Jean,

Yeah I figured out that I shouldn’t be parenting network views when I was researching the subject. Is there a sample for pun 2 for communication between players? I only saw the simple connection sample. Or should I just download the pun classic samples, it’s the same logic right, just different actions?
Title: Re: Photon Pun 2 Trying to set parent on all clients for an instantiated gameobject
Post by: jeanfabre on May 13, 2020, 01:34:59 AM
Hi,

 yes same logic, just different names conventions and clean up of internal code.

Bye,

 Jean