Hello all,
sorry if this is a dumb question…
I have 2 C# scripts , one has this little bit of code:
void OnPlayerKill(NetworkPlayer player)
{
Debug.Log("Cleaning up after player " + player);
Network.RemoveRPCs(player);
Network.DestroyPlayerObjects(player);
int randomSpawn = Random.Range(0, spawnZones.Length - 1); // We're choosing random spawn points from an array just for convenience here - you can handle this how you like, just keep in mind: Network.Instantiate creates the object on everyone's end
int i = Random.Range(0, Heros.Length);
GameObject networkPlayer = Network.Instantiate(Heros[i], spawnZones[randomSpawn].transform.position, Quaternion.identity, 0) as GameObject;
networkPlayer.GetComponent<NetworkView>().RPC("SetUsername", RPCMode.AllBuffered, advancedSettings.username);
}
I am trying to link that void onplayer kill to this other c# script that has this code:
void OnCollisionEnter(Collision col)
{
if (col.gameObject.name == "earthwall")
{
//do the other scripts onplayerkill please
}
How would I actually do this?
Thanks in advance