front camera detection UI is under my camera

hi, im working on an Android game I need to detect if there’s a front camera. my UI is under my camera on my pixel 4. so I can move the UI under the camera thanks

I’d start by writing detection code to fetch the phone’s front camera. Then go from there. Read some documentation on how to do this.

hi, nilagard I got it working but cant us canvas. have put all the UI in one to move it all down

private WebCamTexture frontCam;
    public GameObject canvas;

    // Start is called before the first frame update
    void Start()
    {
        WebCamDevice[] devices = WebCamTexture.devices;
        if(devices.Length == 0)
        {
            Debug.Log("no cam");
            return;
        }

        for (int i = 0; i < devices.Length; i++)
        {
            if(devices*.isFrontFacing == true)*

{
Debug.Log(“has front cam”);
frontCam = new WebCamTexture(devices*.name, Screen.width,Screen.height);*
}
}

if(frontCam == null)
{
Debug.Log(“has no front cam”);
return;
}

Debug.Log(“moving cav”);
Vector2 move = canvas.transform.position;

move.y += -100f;

canvas.transform.position = move;

Debug.Log(“moved can”);
}