I have a cube within my scene with the below Fire script attached. The object also has a photon view component.
The photonView.isMine is always false, unless you trigger the collider with the master client / the first to connect to the room.
The cube is set as a scene object. Do I need to move that functionality into an RPC call to .All?
The photonView.isMine is always false, unless you trigger the collider with the master client / the first to connect to the room.
The cube is set as a scene object. Do I need to move that functionality into an RPC call to .All?
public class Fire : Photon.MonoBehaviour
{
private SphereCollider _sphereCollider;
private float _heatIncrement = 10f;
void Start()
{
_sphereCollider = GetComponent<SphereCollider>();
if (_sphereCollider == null) throw new MissingComponentException("Sphere collider missing");
}
private void OnTriggerStay(Collider other)
{
if (other.tag != "Player") return;
if (!photonView.isMine) return;
PlayerNetwork player = other.GetComponent<PlayerNetwork>();
if (player == null) throw new MissingComponentException("Player missing Player script.");
player.IncreaseTemp(_heatIncrement * Time.deltaTime);
}
}