Photon Animator (Help Needed)

Options
Hello i'm having issues with Photon Animator View because i'm trying to sync an animation but it won't work, when a new player joins they will see an helicopter (which moves if a player triggers it) idle, but for other players it will play test animation using animator.play (which is the animation that makes the helicopter move) and also in the script that triggers it has some delay to other players which will cause for other players the animation not playing or the animation plays but has a delay of 0.2 seconds which causes some issue.
How can i fix this?
My code:
using UnityEngine;
using Photon.Pun;
public class coolhelicopter : MonoBehaviourPunCallbacks {
    public Animator thingy;
    void OnTriggerEnter(Collider other) {
        if (other.gameObject.CompareTag("Player")) {
            thingy.Play("test");
        }
    }

    void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info) {
        if(stream.IsWriting) {
            stream.SendNext(thingy);
        }
        else {
            thingy = (Animator)stream.ReceiveNext();
        }
    }
}
My Photon Animator View settings:
https://imgur.com/a/NZxJJhz

Comments

  • Any solution?
  • Lethn
    Options
    Don't use Play as you can't synchronise the parameters within Photon Animator View, use SetTrigger or SetBool instead and go through the list and change your options. I just set all of my parameters to continuous since I'm often using those animations constantly anyway and it should work after that.
  • Hi @Lethn I used trigger once but it didnt work, Bools were another problem too because they kept going idle and test animation so the gameobject was having was going insane
  • Lethn
    Options
    Did you set up your transitions correctly? They don't operate the same way as Play does.
  • @Lethn Now it works dont know what i did wrong before, how can i synchronize with bools?
  • Lethn
    Lethn
    edited May 2020
    Options
    It's probably to do with the transitions and to synchronise with bools you do the exact same thing. The majority of the problems I had with Bools and Triggers in the animator were to do with the way I was setting up the animator rather than photon so it's just a matter of working the behaviour.

    Now you mention it, I don't understand why they don't add support for Play as it's way more convenient to use but maybe they have their own reasons for that.
  • @Lethn It still wont synchronize perfectly with bools, it just wont synchronize it will be delayed to other players