I am using Unity3D with Photon, and I need to blur the camera of another player.
Does anyone have an idea of how can I do this?
I am using Unity3D with Photon, and I need to blur the camera of another player.
Does anyone have an idea of how can I do this?
Add a PhotonView script to the camera object and a script to blur the camera object. Then create the script below and add it to the camera object Pressing the space key creates a camera blur effect for the opponent.
public class PunCamera : MonoBehaviour
{
private void Update()
{
if(Input.GetKeyDown(KeyCode.Space))
{
OtherPlayerBlur();
}
}
public void OtherPlayerBlur()
{
//Get the PhotonView in the camera object and call the RPC
var _photonView = this.GetComponent<PhotonView>();
_photonView.RPC("PunCameraBlur", PhotonTarget.Others);
}
[PunRPC]
private void PunCameraBlur()
{
// Camera Blur Method Call
}
}