using Photon.Pun;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayAnimation : MonoBehaviour
{
[SerializeField] private Animator animator;
[SerializeField] private string nuke = "nuke";
public AudioSource nukeSound;
private PhotonView PV;
private void Update()
{
PV = GetScript.pView;
}
private void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag("Hand"))
{
if (other.CompareTag("Hand"))
PV.RPC("RPC_playAnim", RpcTarget.AllBuffered);
PV.RPC("RPC_sound", RpcTarget.AllBuffered);
}
}
}
[PunRPC]
void RPC_sound()
{
nukeSound.Play();
}
void RPC_playAnim()
{
animator.Play(nuke, 0, 0.0f);
}
}
That is my script and the error
I tried messing around with the photon views with the rpc's and nothing seems to work,
I even tried testing different photon views but it didn't help if someone could help it would be very appreiciated.