playMaker

Author Topic: Photon Random Spawn for both Players  (Read 1811 times)

Nikolasio

  • Playmaker Newbie
  • *
  • Posts: 23
Photon Random Spawn for both Players
« on: March 31, 2017, 12:28:47 PM »
Hi,

In the repro attached, 3 game objects are spawned at random out of 5 positions.

I want to set this game object fsm active from a game manager script. Without any Photon components or actions I obviously get 2 different random spawns for the respective players.

But I want both players to have the same random positions to start with (so player one will see his game objects on top of the other player's game objects).

I tried to set the game object fsm active from script with a RPC from the masterclient but that didn't work.
So I think the RPC has to come from within the fsm.

Any thoughts on how to do that?

Best regards
Nikola
 




 

 

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon Random Spawn for both Players
« Reply #1 on: April 06, 2017, 01:51:14 AM »
Hi,

 I would not use RPC but instead Room properties or PlayerProperties.

if you use Room Properties, you can store the spawn position you want and players will check that befor emaking themsevles appear in the world.

 If you use Player Properties, the second player will check the first player properties and match the spawn position.

 Bye,

 Jean

Nikolasio

  • Playmaker Newbie
  • *
  • Posts: 23
Re: Photon Random Spawn for both Players
« Reply #2 on: April 06, 2017, 03:15:18 AM »
Hi,

Idd the photon instantiate didn't work from within the RPC.

Thx for the tips!

Cheers,
Nikola