playMaker

Author Topic: Photon Network Player Custom property - gameObject  (Read 1320 times)

600

  • Sr. Member
  • ****
  • Posts: 493
    • View Profile
    • Car and Traffic Playmaker assets
Photon Network Player Custom property - gameObject
« on: August 06, 2014, 11:43:45 AM »
Hello,

Posting this regarding a Skype group conversation.

Setup:

In Scene there are a "Sync Manager" for animations for Players.

- A Player sends his variables with RPC to Manager,
- it recieves animation string,
- converts to float,
- gets Player Name string,
- and Finds Gameobject by Tag a player to set that info.


Thinking to avoid this extra finding thing looked into Player Custom Property,
there are dropdown menu with gameObject variable.
For now I get an error, but fsm still running and stuck at that state.
please check picture bellow.
Floats and Ints works allright.

Could I send this data somehow so a reciever gets that Players gameobject match?
All Players have Photon View and gameObjects are renamed to Users custom name when joined.

Thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
Re: Photon Network Player Custom property - gameObject
« Reply #1 on: October 20, 2014, 12:17:39 AM »
Hi,

 You can not pass GameObject references across the network. you need to pass its name. If the name is not unique, then you'll need to implement a system to reference in each scenes a particular object using a string, or an int, or something.

I have added this case in the trello task to warn users of this case where gameobject ( textures and materials, as well) can't be sent across the network.

 Bye,

 Jean

ps: having said that, I should implement a case where if the user wants to send a gameobject, it can only send one that has a network view and then I only pass the viewID, and find it automaticall when the other side received this reference. I have implemented something like that with uLink, I'll spread this back to photon.

https://trello.com/c/7uuBZfv8/7-photon


600

  • Sr. Member
  • ****
  • Posts: 493
    • View Profile
    • Car and Traffic Playmaker assets
Re: Photon Network Player Custom property - gameObject
« Reply #2 on: October 20, 2014, 07:27:17 AM »
Thanks for the reply,

its a great idea about viewID to send id with auto-find its "other side",
that would be sooo convenient :)

Now I have a system something you suggested, but its all manually looped while finding etc. Most important that it works,but could be optimized in future with this autoID-feature :)

Checking trello, thanks!