Search code examples
androidvirtual-realitygoogle-cardboard

How to zoom in out with the Google cardboard


I'm working in a project with the cardboard from Google. I'm asking if there is someone who have the possibility to help with understanding and creating a script for the zoom in and out with the magnet tool on the cardboard. Thanks a lot for your help.


Solution

  •  Used this code 
    @Override
    public void onCardboardTrigger() {
    if (xyz) {
     //Create a function 
    zoom();
        ...
    } else {
    
    }
    // Always give user feedback
      mVibrator.vibrate(50);
    }