PHOTON: How to synchronize animation/bool from other client ot MasterClient? PUN RPC

Hello I’m really confused about RPC. How to make the animation/command play on opening doors to all client? I have tried youtube tutorials, I only sync Masterclient to other users POV. But when other users open the door, it does not sync to Masterclient.

Need help…

void Update()
{
    if (Input.GetKeyDown(KeyCode.F))
    {
        Pressed();
    }
}


public void Pressed()
{
     
    if (Physics.Raycast(PlayerCamera.transform.position, PlayerCamera.transform.forward, out doorhit, MaxDistance))
    {
       
        if (doorhit.transform.tag == "Door" && key1 == 1)
        {
            anim = doorhit.transform.GetComponent<Animator>();    //THIS IS THE CODE OPENING THE DOOR
            audio1 = doorhit.transform.GetComponent<AudioSource>();
            opened = !opened;
            anim.SetBool("Opened", !opened);
            audio1.PlayDelayed(openDelay);
           
        } 
    }
}
}

You are asking a question about a RPC which is not working. Where is said RPC? You do not define one in the code you provided.

In general try to stick to the example given in the Official Documentation about RPCs. There are examples on how to use this.
In general you will need the reference to a PhotonView which is correctly initialized on all Clients. Then you will need a function to open your door like this:

[PunRPC]
void OpenDoor()
{
     //do all door open stuff inside here
}

Then to trigger this for everyone you have to call this:

photonViewReference.RPC("OpenDoor", RpcTarget.All);

Please update your code accordingly if there is code missing or change your description to tell us better what is going on with your RPC.