Photonview on child object of player with photonview

I have a player GameObject in my game with a photonview attached and it is observing the transform and the rigidbody.

A child object of the player GO has a particle emitter that can turn on and off. I would like to synchronize the particle emitter's state.

How do I best accomplish this?

Thank you.

Comments

  • public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
    {
    if (stream.IsWriting)
    {
    stream.SendNext(On);
    }
    else if(stream.IsReading)
    {
    On = (bool)stream.ReceiveNext();
    }
    }
Sign In or Register to comment.