playMaker

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

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 713
    • Flashing Lights
Photon Network Player Custom property - gameObject
« on: August 06, 2014, 02:43:45 PM »
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: 15500
  • Official Playmaker Support
Re: Photon Network Player Custom property - gameObject
« Reply #1 on: October 20, 2014, 03: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

  • Beta Group
  • Hero Member
  • *
  • Posts: 713
    • Flashing Lights
Re: Photon Network Player Custom property - gameObject
« Reply #2 on: October 20, 2014, 10: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!