playMaker

Author Topic: can not figure out how to use the " Photon View Get Is Mine" event.  (Read 3857 times)

greatnate62

  • Playmaker Newbie
  • *
  • Posts: 1
So i can not for the life of me figure out how to use the  Photon View Get Is Mine event. im trying to make a simple project with a network. i have everything set up in this order.
1. set up everything in the wizard correctly.
2. have events for connecting to cloud and telling player with a string variable.
3. joined ""room 1". if not then create "room 1"
4. have two players in "room 1"

so everything at this point works. both clients are connected to one room. the problem is that each client controls both players. i know the " Photon View Get Is Mine" event has something to do with it but i cant figure it out.

if someone could give me like a step by step thing, that would be awesome!

jeanfabre

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

It's ok, once you pass this concept, you'll feel a lot more in control.

I'll try to be concise:

Computer A
Computer B
Player A
Player B

When Player A starts your game on Computer A, The prefab you instanciate for Player A will return "TRUE" for the "Is mine" action.

When Player B starty sour game on Computer B, Photon will want to show Player A, and will instanciate the same prefab it did on Computer A, BUT this time the instance of Player A will return "FALSE" for the "Is mine" action.

so "is mine" means: is this prefab instance is owned by the player playing on this very computer, or is it a represenation of another player, playing on a different computer.

Does that make more sense?

 and so, now comes the critical use of this information, since Player A and Player B will share the same prefab, use the "is mine" information to shut down input control when it doesn't apply. here is simple bullet point:

Computer A - Player A instance : is mine = true  : WRITE data  : User input ON
Computer A - Player B instance : is mine = false : read data     : input OFF
Computer B - Player A instance : is mine = false : read data     : input OFF
Computer B - Player B instance : is mine = true  : WRITE data  : User input ON


Bye,

 Jean