Question by
emirsoylu03 · Aug 08, 2020 at 08:41 PM ·
camerascripting problemnetworkingservervideo
I'm trying to transfer the display from my phone camera to my computer (Realtime!)
Hello everyone!
I'm trying to transfer the display from my phone camera to my computer (Realtime!). So I use PUN2 I connected my devices to the same server. And I wrote a little CameraAccess script. This is it:
public class CameraAcces : MonoBehaviour
{
static WebCamTexture BackCam;
public string AdminDeviceName;
void Start()
{
if(BackCam == null)
{
BackCam = new WebCamTexture();
}
GetComponent<Renderer>().material.mainTexture = BackCam;
if (!BackCam.isPlaying)
{
BackCam.Play();
}
}
And I threw this SCRIPT into a PLANE on scene. Now When I connect the devices to the same server, I only see the display from their cameras. How can I transfer the display from my phone camera to my computer? Thanks for your help and sorry for my bad English. Note: This is my DeviceMenager script:
public class DeviceMenager : MonoBehaviour
{
PhotonView PV;
Vector3 currentEulerAngles;
Quaternion currentRotation;
public GameObject CamLoc;
void Awake()
{
PV = GetComponent<PhotonView>();
}
void Start()
{
if(PV.IsMine)
{
CreateController();
}
currentEulerAngles = new Vector3(90,180,0);
currentRotation.eulerAngles = currentEulerAngles;
}
void Update()
{
}
void CreateController()
{
//PhotonNetwork.Instantiate(Path.Combine("Photon Prefabs", "DeviceController"), Vector3.zero, Quaternion.identity);
PhotonNetwork.Instantiate(Path.Combine("Photon Prefabs", "CameraTracking"), new Vector3(0,0,10), CamLoc.transform.rotation);
}
}
Comment