playMaker

Author Topic: Playmaker Photon turn base game player instantiate in different location[SOLVED]  (Read 877 times)

unclefour

  • Playmaker Newbie
  • *
  • Posts: 3
Hi I have a bit time to work at playmaker, but just start doing the network using photon pun for turn base game. I got the logic in single player mode and I  think I have a simple idea how to get them work online.

However, I stuck in the first step...  :'( Like many turn base game when two player join in the room, the charater game object should stand in oppsite of other. So when the first player create the room and spawn in one location the other player join should spawn in other location which is opposite of the first.

I try like make a bool value sync, when the first player get in and spawn then change the bool to true. When the other join room get the bool value and test if is true the spawn in other location. It looks like doesnt work because the other player cant get the bool value from network sync.

Is there any simple way I can achive this? Thank you.
« Last Edit: June 04, 2019, 04:07:08 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

 yes, you can get the value, simply store this boolean in custom room properties.

you can also create a network scene object that assign player position, so it's always the masterclient that tells where a player should go, which means it can't get it mixed up since only the masterclient gets to decide, so you can keep that bool as a local variable instead of a networked variable.

Bye,

 Jean




unclefour

  • Playmaker Newbie
  • *
  • Posts: 3
Oh it works thanks Jean  ;D ;D