Received RPC but nothing happens
Options
Kegyar
✭
Hello All, My first time posting here.
All of a sudden, my RPC doesn't work. In the console i can see "received RPC: RPC_FireMissile" but nothing happens. At the very least it should print my "fiiiiire" but it doesn't.
Any suggestions?
Here are my Code snippets:
All of a sudden, my RPC doesn't work. In the console i can see "received RPC: RPC_FireMissile" but nothing happens. At the very least it should print my "fiiiiire" but it doesn't.
Any suggestions?
Here are my Code snippets:
public void Fire1() { if (Time.time < nextFireTime) return; player.playerShooting.Play(); nextFireTime = Time.time + fireDelay; photonView.RPC("RPC_FireMissile", Photon.Pun.RpcTarget.All); } [PunRPC] void RPC_FireMissile(PhotonMessageInfo info) { print("FIIIIIRRREEEE"); Vector3 playerPos = transform.position; Vector3 playerDirection = transform.forward; float spawnDistance = 10; Vector3 spawnPos = playerPos + playerDirection * spawnDistance; var missile = Instantiate(missilePefab, spawnPos, transform.rotation); missile.SetOwner(info.photonView); missile.gameObject.SetActive(true); }
0