A question regarding networking...

I have a question regarding the following script:- (FPS Game Script)
I want to find an object named player which are many in a multiplayer game.
So the question is, If i use networkView.isMine boolean (bool) , the game will find only that player object which is played by one player, and if I want to destroy only the body of the player who dies, only it will be destroyed or others will also be destroyed???

using UnityEngine;
using System.Collections;

public class NetworkingScript : MonoBehaviour
{
	

	void Start ()
	{

	}

	void Update ()
	{
		if (networkView.isMine)
		{
			if (GameObject.Find("Player"))
			{
				Destroy(GameObject.Find("Player"));
				Destroy(gameObject);
			}
		}
	}
}

Thanks in advance…

You want to use Network.Destroy(NetworkViewID);

The issue with using GameObject.Find(“Player”) though, is that if your objects are network instantiated, then it will find all players in the scene. Your best bet is using NetworkView.Find(NetworkViewID), OR put a tag on the players, FindObjectsWithTag(“Player”), then iterate through them to see which NetworkView is owned by you.

Cheers

I belive you are looking for something like this:

I don’t think that script will have the intended effect, you are checking whether something isMine before you are finding the player, but I’m not positive what you are trying to achieve, if you want to destroy the player controlled by the client that that script is being run on, then find all of the players and for each of them check their isMine, and if its true, then destroy them.