Это нужно сделать с помощью RPC, но это также локальный объект: обычный Instantiate< использовался /code>, а не PhotonNetwork.Instantiate.
Это код:
Код: Выделить всё
if (Input.GetMouseButtonDown(1))
{
Ray ray = _camController.PlayerCamera.ScreenPointToRay(Input.mousePosition);
// Casts the ray and get the first game object hit
if (Physics.Raycast(ray, out RaycastHit hit))
{
if (hit.collider.tag == "test")
{
Destroy(hit.transform.parent.gameObject);
Debug.Log("Hit");
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/742 ... aycast-rpc