Start a new topic

Camera Flash

Hi I am trying to use camera flash on my AR project. 

i tried using the sample cs that came with the wikitude sample scene however i was not able to access any of my touch or button features with the codes i wrote. I tried separating the code from the sample code but still doesn't work. can anyone help me with this. (beginner programmer) 


using UnityEngine;

using UnityEngine.UI;

using Wikitude;

using System.Collections;


public class CameraSettingsController : SampleController

{

    public WikitudeCamera Camera;

 

    public GameObject FlashModeLayout;

    public Dropdown FlashModeDropdown;

   


    public void OnCameraOpened() {

        PositionDropdown.value = (int)Camera.DevicePosition;

        

        if (Camera.IsFlashModeSupported(CaptureFlashMode.On)) {

            FlashModeLayout.SetActive(true);

            FlashModeDropdown.value = (int)Camera.FlashMode;

        } else {

            FlashModeLayout.SetActive(false);

        }

    }


    public void OnCameraControlsButtonClicked() {

        ControlsLayout.SetActive(!ControlsLayout.activeSelf);

    }


    public void OnPositionChanged(int newPosition) {

        Camera.DevicePosition = (CaptureDevicePosition)newPosition;

    }


    public void OnFlashModeChanged(int newFlashMode) {

        Camera.FlashMode = (CaptureFlashMode)newFlashMode;

    }


   

}


Hi, 


Do you have any errors printed in the console, either in logcat when running on Android, or in the Xcode console for iOS?

The code that was posted assumes that the right GameObjects / Components were assigned in the inspector for this script. Can you please double-check that this was done correctly?


Thank you,
Alexandru

Hi I am using the unity extension and I'm trying to build for both android and ios. I am using wikitude 8.1 and the sample scene works but when I use the format for the sample scene my world space buttons as well as other touch functions which use to work doesn't I have compared two different scenes built the same way one using the sample scene as the base and one without so that's why I'm just trying to get the flash part only

Hi Yovanni,


Please provide the following details:


- Which version of the SDK are you using?
- Confirm that you’re using the Unity extension?
- What device / OS does this happen with?
- is this happening also in the sample app?


Greetings

Nicola

Login or Signup to post a comment