Parameter type does not match (remote Animator)
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation on PUN.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
Parameter type does not match (remote Animator)
Kekora
2017-02-23 14:28:19
Hi, I am trying to read a value from a remote player's Animator.
this is one that works fine...
private int combat_anim;
private Animator anim;
combat_anim = Animator.StringToHash("combat_anim"); //in start()
anim = myDood.GetComponent
float weap_current_anim = anim.GetFloat("combat_anim"); //in a coroutine
this is one that does not work fine...
private int race;
private Animator anim;
race = Animator.StringToHash("race"); //in start()
anim = myDood.GetComponent
float tmp_remote_race = anim.GetFloat("race"); //in fixedUpdate if photonView is not mine
both are floats in the Animator and set to Discreet. Below is the full error in Unity:
Parameter type 'race' does not match.
UnityEngine.Animator:GetInteger(String)
PhotonAnimatorView:SerializeDataDiscretly(PhotonStream) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/Views/PhotonAnimatorView.cs:399)
PhotonAnimatorView:OnPhotonSerializeView(PhotonStream, PhotonMessageInfo) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/Views/PhotonAnimatorView.cs:520)
PhotonView:ExecuteComponentOnSerialize(Component, PhotonStream, PhotonMessageInfo) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonView.cs:509)
PhotonView:SerializeComponent(Component, PhotonStream, PhotonMessageInfo) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonView.cs:434)
PhotonView:SerializeView(PhotonStream, PhotonMessageInfo) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonView.cs:327)
NetworkingPeer:OnSerializeWrite(PhotonView) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:3979)
NetworkingPeer:RunViewUpdate() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:3876)
PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:160)