stream layerweights onphotonserializeview
hey guys how can i receive a layer weight in onserializeview photon
stream.SendNext(anim.GetLayerWeight(4)); // sending
anim.SetLayerWeight(4,(float)stream.ReceiveNext()); // receiving
i dont know if this is the way but it is not working i think the sending is but receiving does not
this is how i did my layerweight
if (isFiringGun == true)
{
currentWeight = Mathf.Lerp(currentWeight, 2.0f, Time.deltaTime); anim.SetLayerWeight(4, currentWeight);
}
if (isFiringGun == false || Input.GetMouseButtonUp(0))
{
currentWeight = Mathf.Lerp(currentWeight, 0.0f, Time.deltaTime); anim.SetLayerWeight(4, currentWeight);
}
this works fine on my client. but it is no streamed like this it seems to me that only the base layer is streamed like this for instance not the other layers and they`re weights
public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info) {
if(stream.isWriting) {
stream.SendNext(transform.position);
stream.SendNext(transform.rotation);
stream.SendNext(anim.GetFloat("Speed"))
realPosition = (Vector3)stream.ReceiveNext();
realRotation = (Quaternion)stream.ReceiveNext();
anim.SetFloat("Speed", (float)stream.ReceiveNext());
i did als somthing like this before. and some one responded but i am not shure how to get this working
Your answer
Follow this Question
Related Questions
[CLOSED]Problem with serialization after PUN update 2 Answers
How to Ignore Collisions Between a Layer and a LayerMask? 1 Answer
2D: Erase a part of top layer to see the background 0 Answers
How to turn everything black except from certain objects in the scene in a first person camera view 1 Answer
How can I layer images and mesh? 0 Answers