Log in or register to post comments

Toggle ARCamera and non AR Camera?

March 16, 2011 - 2:09am #1

It looks like if I have both the regular and the ARCamera active when I build and deploy the ARCamera will show static when I toggle from regular cam to ARCam... (the regular camera is set inactive)

Is there a way to toggle at runtime between AR mode camera and a regular camera in Unity

Re: Toggle ARCamera and non AR Camera?

March 22, 2011 - 9:36am #3
ina wrote:

Is there a way to toggle at runtime between AR mode camera and a regular camera in Unity

To essentially toggle between two cameras I attached two camera scripts to one camera. One being the TrackerScript. Then I enabled and disabled the other script as necessary. It required a bit of fiddling but it works well now.

My goal was to let them use a different camera interface when a trackable wasn't present so it may not apply to what you are trying to do.

Re: Toggle ARCamera and non AR Camera?

March 16, 2011 - 8:44pm #2

I haven't worked with multiple cameras much, but it looks like playing with the depth isn't enough to solve this problem. I might add a little script to each camera, that deactivates one camera depending on whether the app is running in the editor or not.

public class EditorOnly : MonoBehaviour
{
    void Start () {
        if (!Application.isEditor)
            gameObject.active = false;
    }
}
public class DeviceOnly : MonoBehaviour
{
    void Start () {
        if (Application.isEditor)
            gameObject.active = false;
    }
}

- Kim

Log in or register to post comments