Animator view and triggers

Hi,

I have unity 2018.3 with the latest pun 1.92. I'm unable to get triggers working with the animator view.

I've read everything I can, so to confirm:

-Animator view is the last script in the prefab stack, and the last in the photon view option list - I've deleted and recreated it several times to ensure its definitely last in the stack and photon view.
-I use continuous.
-(One thing I noticed was the culling script adds itself automatically to the photon view list, even if its there already.. I tested by removing the culling script completely but the animations still do not work with the culling script active or deleted so its not this that is stopping animations - thought I'd mention that though..)

I never see the trigger change from false to true in the inspector view, and running with two players, the second player never sees the animations.

Is there a demo on this so i can check everything matches or some other trick to getting this working?

Is there a way to get it working via the OnPhotonSerializeView script ? i.e. the stream.sendnext and receive.next ? - I tried but could not work it out.

and no I really don't want to go through 100+ animation states and change them all to bools, almost all assets and creators are using triggers these days - the coding headache would be insane - surely you photon guys have a solution.
I see you struggling for a few years now with this issue and I do appreciate the single frame thing, but is there nothing that can be done ? :)

Kind Regards

Carme

Comments

  • ah nvm. Work around with ints I can sync easily without changing triggers to bools in the animator itself.

    With user input like (space bar for jump) I set an int to a number corresponding to the the animation, I then use OnPhotonSerializeView script to check if the int > 0 if so, then map the corresponding animation, run the trigger and set the int back to 0.

    In the:
    public int Photnet_AnimationSync = 0;
    Animator anim;

    in start :
    anim = GetComponent();

    if (stream.isWriting)
    {
    if (Photnet_AnimationSync > 0)
    {
    stream.SendNext(Photnet_AnimationSync);
    Photnet_AnimationSync = 0;
    }
    }else
    {
    Photnet_AnimationSync = (int)stream.ReceiveNext();

    switch (Photnet_AnimationSync)
    {
    case 2:
    anim.SetTrigger("longjump2");
    Photnet_AnimationSync = 0;
    break;
    case 1:
    anim.SetTrigger("shortjump1");
    Photnet_AnimationSync = 0;
    break;

    }
    }

    Photnet_AnimationSync gets the int number from whatever your animation script is.

    Seems to work, I thought the photon animator view was to good to be true :) -still half a solution.
  • Hello! I am having the same issue, I think. I just opened a thread as I did not noticed yours. Please could you explain how to use that OnPhotonSerializeView? I'd like to learn how to see all the animation in a multiplayer scene!
  • Hi!

    "Photnet_AnimationSync = (int)stream.ReceiveNext();" must give you "InvalidCastException: Specified cast is not valid" because you are only sending value when it changes but you are receiving it every serialize. How did you handle it withouth sending Photnet_AnimationSync when it doesn't change?