streaming layerweight onserializeview

hey guys i am struggling with streaming of my layer weight i have multiple layers on my character on my side it works all other animations on the base layer are streaming and receiving but my animation on layer 4 isnt because i cant seem to get this right i tryed google i do know it wants a float weight but i dont understand isnt the float alreddy done in my client/my side ?.

…OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)…

stream.SendNext(anim.SetLayerWeight(4, (float)); // this one it says invalid expression term
anim.SetLayerWeight(4,(float)stream.ReceiveNext()); //this one i didnt get error

this is how i did my layer weight

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);

Well this line:

stream.SendNext(anim.SetLayerWeight(4, (float)); 

makes no sense on multiple levels. First of all SendNext expects a value that it should serialize and send over the network. However SetLayerWeigth does not return any value, so you can not pass the result to SendNext. Furthermore the second argument of SetLayerWeight should be the weight value you want to set. Though you currently have (float) there which makes no sense.

If you want to send your current layerweight you either want to send your “currentWeight” value, or if the sending happens on a seperate script, you probably want to use GetLayerWeight instead of SetLayerWeight in the offending line.