Search Unity

Problem with using device camera in two scenes

Discussion in 'Android' started by Fira, Sep 22, 2017.

  1. Fira

    Fira

    Joined:
    Jan 9, 2013
    Posts:
    8
    Hi guys

    My application has the following scenario:

    Scene 1 - Scene with an augmented reality plugin that uses the camera of the cell phone
    Scene 2 - Scene with a plugin to read bar code, also uses the camera of the cell phone.

    These scenes are totally separate, have no reference to each other, the scripts used are different, have no object with "dont destroy onload".

    My problem is this: both scenes work perfectly, but when I go from scene 1 to scene 2 the bar code reader stops working, the camera even initializes but it seems that it does not scan the barcode anymore.

    If I start my application directly through scene 2, the bar code reader works normally.

    I do not know how it is possible for two scenes to be influencing each other, could it be something related to objects in memory even after the scene change?
     
  2. talaei69

    talaei69

    Joined:
    Feb 24, 2015
    Posts:
    5
    Hello i don,t know what is your AR plugin in unity only thing i can say for fix this from your description.
    don,t use 2 scene use 1 scene make 2 different camera one setting for AR and other one bar code reader camera for switch between them Activate 1 and deactivate other camera . i hope this solve your problem.