Log in or register to post comments

vuforia unity objects fall through floor when camera loses focus

April 28, 2014 - 6:59am #1

Hi All

I am having a slight problem that I am not to sure how to fix. Well I have an idea but nit sure where to dig for it.

 

Problem is as follows. I have a character and stage setup. Now all works brilliantly except for one thing. When the camera loses the image target  all models disappear as expected. Problem is that my character then falls through the floor, when the camera registers the image target again the stage is displayed again but the character can still be seen falling or is already 100 M down screaming like banshee.

Now I’m not sure if anyone has ran into this problem and have a fix for it?

 

Any help would be greatly appreciated it. Im using C#

Onyx

vuforia unity objects fall through floor when camera loses focus

May 1, 2014 - 10:42am #5

Thank you so much Alex

I will give that a bash. Thank you so much for pointing me in the right direction.

vuforia unity objects fall through floor when camera loses focus

May 1, 2014 - 8:13am #4

Martin,

you can do it this way:

 

click your ImageTarget, in the inspector you should see a DefaultTrackableEventHandler (Script) double click the script name to edit it.
there you will find OnTrackingFound() and OnTrackingLost()

you can add your own functionality those two functions .... maybe there's a more elegant way, for not having to edit that file, but that's what I'm doing so far and works great.

 

 

vuforia unity objects fall through floor when camera loses focus

May 1, 2014 - 8:08am #3

Hi Alex

thank you for your response. I was thinking I the same direction but not sure how I would determine when the camera has lost focus. I'm a bit of a noob so most of this is pretty new to me lol. I am assuming there is a public variable in the vuforia code that holds a false or true val for camera detecting the marker. I just can't seem to find it. 

i was also thinking of just disabling physics while camera has lost the marker? Wouldn't this also have the same result? 

i am pretty sure I will be able figure out how to solve this once I figure out where the vuforia code is keeping track of the marker visible true or false. If you could point me in that direction. I will be able to figure the rest out. 

 

Once again thank you so much for  actually trying t help

Martin

vuforia unity objects fall through floor when camera loses focus

May 1, 2014 - 4:39am #2

Hi Onyx, have you tried to pause Time the scene when focus is lost, and resume when it's found?

Time.timescale = 0f; // this pauses the time

Time.timescale = 1f; // this resumes it at normal speed.

When timescale is 0, no FixedUpdates are ever performed, so that should stop all physics simulations while you recover focus.

Log in or register to post comments