playMaker

Author Topic: Photon Pun 2 Trying to set parent on all clients for an instantiated gameobject  (Read 989 times)

serenefox

  • Full Member
  • ***
  • Posts: 135
    • View Profile
    • Serenefox Games
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!
Most Recent Published Games:
Juicy Theater - Android

serenefox

  • Full Member
  • ***
  • Posts: 135
    • View Profile
    • Serenefox Games
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.
Most Recent Published Games:
Juicy Theater - Android

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15494
  • Official Playmaker Support
    • View Profile
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

serenefox

  • Full Member
  • ***
  • Posts: 135
    • View Profile
    • Serenefox Games
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?
Most Recent Published Games:
Juicy Theater - Android

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15494
  • Official Playmaker Support
    • View Profile
Hi,

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

Bye,

 Jean