Observed scripts have to implement IPunObservable.

Options
Hello,

In addition to errors I had in playing the demo, I also have this error:

https://hutonggames.com/playmakerforum/index.php?topic=20976.msg92072#msg92072

I don’t understand how there isn’t allow of talk about this error.

Thanks,
jrDev

Comments

  • jeanfabre
    Options
    Hi,

    replied there,

    Bye,

    Jean
  • jeanfabre
    Options
    Hi,

    just for the quick explanation, you can't observer a component that doesn't implement IPunObserable, that's it, so in this case, the PlayMaker proxy is not supposed to be observed, it's not its purpose.

    Bye,

    Jean
  • jrDev
    Options
    Hello,

    Are you saying that the Playmaker Proxy Prefab is not setup properly by default? It shouldn’t be observing itself in the Observed components section like it currently is? See the pic I posted on the other forum.

    Thanks,
    jrDev
  • jrDev
    Options
    So I did just that and removed the Observed component to none and now I can connect to the room with 2 Clients. This needs to be fixed in the official PUN2 actions on the Ecosystem browser because the PlaymakerProxy Prefab automatically has itself Observed...

    Hopefully this helps anyone that currently downloads and have this issue until it’s officially fixed...
  • TenFiddy
    Options
    Is there any fix to this? ... To be clear. My game, using playmaker, works perfectly with Pun2 except for Net Sync on variables. When I put the FSM, with the sync'd variables, into the observable (On photon view script in the inspector) - I get the error "Observed scripts have to implement IPunObservable. BOX_INFO(Clone) (PlayMakerFSM) does not. It is Type: PlayMakerFSM"

    I am only using Integers and Vector3 variables. And the game object is just used to hold data...and not much data. Like score (INT) and Hole position (Vector3) for a VR golf game....

    Is there a work around? I am using this for scoring and positioning only.
    I even tried a new build with Pun Classic - same result
    Please help if you can. Thanks
  • Tobias
    Options
    The topic is over a year old. Let us know which version of PUN and PlayMaker you use and maybe we can check.
  • jeanfabre
    Options
    Hi,

    Can you confirm your exact Unity/PUN/PlayMaker versions ?

    are you properly flagging the PlayMaker variables as networked?

    Bye,

    Jean

  • TenFiddy
    Options
    Unity 2019.4.4 LTS, PUN 2.25.1, PlayMaker 1.9.0
    Jean- Thank you for the quick response. I may have found a possible work around right after I asked for help.

    After a lot of experimentation...This is what I figured out. In my case, I have 4 different FSMs, with net-sync'd variables, attached to the game object and all observed in photon view. (Manually) Photon does not like this and gives me the error.

    After looking around at the various options on the Playmaker tool bar I found a "special" FSM that has been prepared just for network use. (go to PlayMaker/Addons/Photon Networking/Components/Add Photon-ready FSM to selected object) To use this: create an empty game object and then use the Component above...it will fill out the game object's hierarchy with the needed scripts. Then use the "special" FSM provided... Set the Observable Search to Manual. Then drag it into photon view "observed components". Set the Observable Search to Manual.

    It seems to work with one observed, net-sync'd FSM, but not with multiple on the same game object. Normal FSMs seem to work fine.

    Work around (the error) for me...BOTH WORK... But I am doing the first option
    1) Put all net-sync'd variables into ONLY one FSM (drag it into photon view "observed components")
    2) Use multiple game objects, each with ONLY one sync'd FSM (drag it into photon view "observed components")

    Remember to put these objects in the Resource folder and use PUN Instantiate.
  • jeanfabre
    Options
    Hi,

    Good, I am glad you found the solution, this is documented in the PlayMaker PUN v1 doc, it's still valid for v2.

    https://hutonggames.fogbugz.com/default.asp?W928

    Bye,

    Jean