Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: MarkD on September 22, 2017, 12:00:20 AM
-
Hey guys -
Learning Photon has really been a challenge for me and I feel like I'm probably making a really simple mistake with all of this.
My current challenge is trying to get sync a boolean value across the network. Rather than post a long description with pictures, I just made a quick video showing what I'm doing in the editor.
Any ideas?
Here's the video:
https://youtu.be/qJnYUGfYXU0 (https://youtu.be/qJnYUGfYXU0)
-
You can use PhotonViewRpcBroadcastFsmEvent, that send a string to one global event inside the players, you can make a simple manager for that with a array and when somebody select one option it send a string (for example player1/argent) to all players arrays. then you can check that array with get next array.
-
Didn't watch the video but if you wanted to sync a Boolean all I would do is add a photon view to your gameobject, drag your FSM that stores the Bool into the "Observed" Box of the photon view. Then make sure you have marked the bool as "Network Sync" Ignoring the error it might give you about it. (I think it expects the unity networking, but we are using photon)
Then Provided that the game object is created on all clients, the Bool should be the same for every player.
(I think you might also need to add a "Photon Game object Proxy" script to your object)
-
Hi,
Have you checked the demo worker scene and tutorial? it will show you how to sync playmaker variables,
https://hutonggames.fogbugz.com/default.asp?W927
https://hutonggames.fogbugz.com/default.asp?W874
Bye,
Jean
-
Thanks guys.
Jean - those tutorial pages are definitely helpful, but I don't seem to be getting anywhere with them.
Here's my really basic setup and assumptions:
- There are two buttons, we'll call them A and B.
Pressing Button A does a Set FSM Bool A to True
Pressing Button B does a Set FSM Bool B to True
A and B are booleans on another game object called "Game Manager"with the following components/settings:
They have network sync checked
They each have a Photon view component (set to Fixed, unreliable on change, observing the FSM from the Game Manager Object.)
They each have a Play Maker Photon Game Object Proxy
From what I've read, I would assume that since they're Network sync'd values and being observed, when I click on button A from my 2nd instance, I SHOULD see that value turn True on my instance running in the editor. But I don't.
What am I missing?
-
Hi,
so both buttons are controlled by the owner of the GameObject right? Are you positive on this, that you use the IsMine action to make sure you only allow the owner of the networked gameobject to write data to the network while the counter parts instances ( where ismine is false) will read the data ( read the fsmBool values)
bye,
Jean