private void PointerMove() { Vector3 temp = Input.mousePosition; temp.z = 10f; // Set this to be the distance you want the object to be placed in front of the camera. Camera camera = cameraControllerPlayer.GetChooseCamera().GetComponent <Camera>(); pointer.transform.position = camera.ScreenToWorldPoint(temp); GetComponent <PlayerMirrorController>().CheckIsClientSendToServerComand(pointer.transform.position); }
private void LookAtCamera() { if (lookinObjectWithTag.Length > 0) { CameraControllerPlayer cameraControllerPlayer = GetComponent <CameraControllerPlayer>(); if (cameraControllerPlayer != null) { foreach (GameObject lookinObject in lookinObjectWithTag) { lookinObject.transform.LookAt(cameraControllerPlayer.GetChooseCamera().transform); } } } }