plz help w/ simple problem and i'll give you my wife
Hi all,
I have an object w/ trigger collider. I want instantiated players to die when they touch the object. The object has a photonview on it and is part of the scene (not instantiated). It uses the following code to call EnterShip on all players.
Players are instantiated and have the follwoing
When the client player touches the ship i get:
i'm just a pinhead client and can't destroy instantiated gameobject
i'm just a pinhead client and can't destroy instantiated gameobject
and both play objects are still present in game.
When the MasterClient player touches the ship i get:
i'm just a pinhead client and can't destroy instantiated gameobject
Ev Destroy for viewID: 1001 sent by owner: True this client is owner: False
and the original MasterClient player is gone and the client player remains.
Please help me. Been trying to fix this for two days. Help very much appreciated!
I have an object w/ trigger collider. I want instantiated players to die when they touch the object. The object has a photonview on it and is part of the scene (not instantiated). It uses the following code to call EnterShip on all players.
public void OnTriggerEnter(Collider other){ if (other.gameObject.GetComponent<morphIntoShip> () != null) { other.GetComponent<PhotonView>().RPC("EnterShip",PhotonTargets.All); } }
Players are instantiated and have the follwoing
using UnityEngine; using System.Collections; public class morphIntoShip : Photon.MonoBehaviour { public void KillPlayer(){ if (PhotonNetwork.isMasterClient) { Debug.Log ("I'm MacDaddy MasterClient and i'm gonna off ya!"); PhotonNetwork.Destroy(gameObject); } else { Debug.Log ("i'm just a pinhead client and can't destroy instantiated gameobject"); } } [RPC] public void EnterShip(){ KillPlayer(); } }
When the client player touches the ship i get:
i'm just a pinhead client and can't destroy instantiated gameobject
i'm just a pinhead client and can't destroy instantiated gameobject
and both play objects are still present in game.
When the MasterClient player touches the ship i get:
i'm just a pinhead client and can't destroy instantiated gameobject
Ev Destroy for viewID: 1001 sent by owner: True this client is owner: False
and the original MasterClient player is gone and the client player remains.
Please help me. Been trying to fix this for two days. Help very much appreciated!
0