Log in or register to post comments

Keep Alive disables image targets

November 21, 2013 - 12:28pm #16

Hello,

I am trying to utilize the keep alive function in the AR Camera prefab. Whenever I enable that option and load my scene, all the image targets that are in the loaded scene are disabled and don't scan. I have followed the directions on the Unity - Scene swap and Data Set persistence post to set t up the AR Camera.

 

Thanks!

Keep Alive disables image targets

November 21, 2013 - 4:01pm #15

Hi, have you made sure that the Data Sets are loaded and activated (see checkboxes under Data Set Load Behaviour component in ARCamera inspector)

?

Also, if you have an ARCamera in the first scene, make sure you don't have any ARCamera in any of the other scenes.

Then it should work.

 

Keep Alive disables image targets

November 22, 2013 - 8:20am #14

Hello,

Yes, I have checked that each daya set is loaded and active in the Data Set Load Behaviour component and I have made sure that there is no other ARCamera in the scene I am trying to load into. My targets in the other scene still load as disabled.

Keep Alive disables image targets

November 22, 2013 - 10:44am #13

Have you tried wihout using the Keep Alive ? (i.e. just creating regular scenes all with ARCamera) ? do you observe the same ?

 

Keep Alive disables image targets

November 22, 2013 - 11:18am #12

It does work without using the Keep Alive option, it only happens when I leave the Keep Alive option on. I thought it was just my project that I was working on, so I started a new project and the same thing happened.

Keep Alive disables image targets

November 22, 2013 - 12:59pm #11

I'm experiencing the same issue when trying to load my main scene that contains the ARCamera and three ImageTargets. Unchecking "Keep ARCamera Alive" doesn't have any issues.

I was using this in my project already, but my main scene was the first loaded scene and I didn't experience this issue then.

I'm using Unity 4.2.2f1 if that helps.

Keep Alive disables image targets

November 22, 2013 - 1:07pm #10

TheRobear wrote:

It does work without using the Keep Alive option, it only happens when I leave the Keep Alive option on. I thought it was just my project that I was working on, so I started a new project and the same thing happened.

I solved the problem for my project by attaching the following script to the ARCamera and the ImageTargets:

#pragma strict

function Awake(){
	DontDestroyOnLoad(this);
}

Keep Alive disables image targets

November 22, 2013 - 2:11pm #9

Thanks for sharing this.

Keep Alive disables image targets

December 21, 2013 - 10:21am #8

After doing some poking around, I was able to get the Keep Alive option to work. I looked at the KeepAliveBehaviour.cs script and I took a look at the OnLevelWasLoaded() function. According to the Unity Scripting Reference documentation, in order for OnLevelWasLoaded to work, an integer needs to be passed in. Otherwise the OnLevelWasLoaded function will not work. You don't have to do anything with the passed intenger, it is just looking for the integer. After doing a few tests, I changed the function to include the integer (ex: void OnLevelWasLoaded(int level)), but even after doing that, the targets were still disabled. So I went through and commented out anything that disabled any tracking behaviours. I found that the section that was supposed to be disabling any WordBehaviours was still disabling any tracking behavours. I commented out lines 262, 263, 276 and 277 and the keep alive function worked.

Keep Alive disables image targets

February 2, 2014 - 10:22am #7

 TheRobear:

i guess this was before Vuoria 2.8? Because now i cannot fiddle with scribts as they are all locked down in some DLL.

 

Anyways, i am having the same problem, our Background is this:

We want to have several AR Worlds and they are not extremly large but on the other hand, we cannot pump x worlds into one scene.

 

Supposed solution:

we use x gameobjects having a custom tracking behavior which just checks: Is my imagemarger beeing found?

If so, load another scene.

 

To optimize everything i try to keep everything identical throughout the scenes alive including GUI, Gamemangers, AR Camera.

 

But when i use this keep Alive option, and come in from another scene, alle my imagetarget GameObject containers with custom tracking scripts get disabled an copys of them with empty properties in their components are being initialized. Trouble is, i cannot see why and under what condition or which objcet is responsible for this.

So i guess i cannot use the keep alive behavior. Which is too bad, because we have a gameobject hirarchie underneath this cam and now i need to disassemble it.

Working with vuforia is really often banging your head against a wall, as soon as you try to do something else besides the tutorials.

And please resolve the naming issue with UILabel, UIButton etc. They are in Conflict with NGUI, which is the most sold Unity GUI solution around and supposed to be the base of the next build in GUI  solution of unity, as the NGUI Developer was hiered by Unity to do this this way.

I could fix this myself but it was another "Aaaarrghh" in my Vuforia experience. 

 

 

 

Keep Alive disables image targets

February 2, 2014 - 11:50am #6

Yes, this was before the latest version of Vuforia. I was thinking about upgraded, but after reading your post, it is a good thing I didn't. The project I used Vuforia on would of definately broke.

I did something similar to what your trying to achieve in the project that I was working on. We created a simple loading script that would load a scene once the image target was scanned. It worked great and keeping the camera alive is crucial in doing this. We found a big issue with both android and IOS if you dont keep the camera alive between scenes. On the IOS side, vuforia would break after loading five scenes. Nothing would work after scanning images and the user would have to restart the app in order to get it working again. On the android side loading scenes would take about five to ten minutes. Scanning images would work fine though. FIxing and using the keep alive script actually fixed both issues and actually increased the loading performance. 

I know what you mean by working with Vuforia. And I am surprised that they locked down the scripts that way. To be honest, I think this takes steps back in creating a clean project. I thought that in reading the issues with the keep alive script, they would at least try to look into the script and find the issue, but from what it sounds like, they didn't even do that. 

It sounds like you should roll back to the old Vuforia version to fix the issue with the keep alive script. If you don't have the old version, send me a pm, I believe I still have the old version of it. 

Keep Alive disables image targets

February 2, 2014 - 11:59am #5

Hello, thank you for your response.

Unfortunatly we cannot "roll back" as the new extended trscking is very suitable to our needs.

I could not think of anything other than having the ARCamera object be alone, not set to keep alive.

Instead i have my additional Setup under another transfrom, which follows position and rotation of the ar camera, and this is now set by script to be not destroyed.

I hope, i can follow my idea like this for now.

Keep Alive disables image targets

October 23, 2015 - 1:18pm #4

I having the same issue  the image targets that are in the loaded scene are disabled and don't scan.

How can i fix this?

Keep Alive disables image targets

February 17, 2016 - 4:54am #3

Hello everybody!

 

Has anyone find an actual solution to this?

My workaround was pretty simple, but I don't think this is the intended behavior. Vuforia should do something about it.

As for my workaround, I just created a new scene, before the first scene that involved AR.

 

In that new scene I added just two things:

  • the ARcamera Prefab
  • A "Loader" object, that just loads the new actual in the first Update()

This seems to work. However, sometimes it shows a texture saying "background texture" for a blip of time. I don't know why.

This is the "Loader" Code for Unity C#:

 
public class Setup : MonoBehaviour
{
    bool loading = false;
    void Update ()
    {
        if (!loading)
        {
            loading = true;
            SceneManager.LoadScene("Your escene here");
        }
    }
}

 

 

Keep Alive disables image targets

April 12, 2016 - 7:20pm #2

Hi! first, sorry for my bad english...has anybody found a solution for the problem of using "keep AR camera alive"? When I used it,  a "background texture" appears sometimes and then the camera continues freezing a little bit. I can´t find the way to fix it. 

thanks in advance.

Keep Alive disables image targets

September 15, 2017 - 2:49am #1

It might not be related, but I have encountered frozen scenes.

The solution was to close a text file I opened in the script.

Log in or register to post comments