hi i’m scripting an online fps game with photon view cloud hosting but i don’t know how to disable bullet collision only on my own character considering that the other players characters are clone of the first one with different istance
Hi,
I guess that you are using PhotonNetwork.Instantiate(…) for instantiating a projectile. In this case you can use the PhotonView’s isMine property and Unity’s OnCollisionEnter callback. this can look like this:
public void OnCollisionEnter(Collision collision)
{
PhotonView pView = collision.gameObject.GetComponent<PhotonView>();
if (pView == null)
{
return;
}
// If you are using tags add a condition for that as well
if (pView.isMine)
{
return;
}
else
{
// Do damage
}
}