how can I look away from a marker and still see my 3D object anchored to the location?
I need to be able to use a marker placed in the real world to trigger my 3D object. However, once triggered, I need to able to look away from the marker and still see my object. Currently, any time I do this, the marker disappears. I've tried World and Look Around options, but those do not make use of markers and allow a lot of swimming of the objects. I need the object to be firmly anchored to a world position.
I hope someone can help.
Thanks!
Hi Campanoodle,
There is a way to do this, but it's not ideal because not all devices support it. If you go down this route, make sure you have a way to fallback to other behavior.
The basic plan is:
1) Use Device Tracking component with World tracking mode to position the camera based on real world movement
2) Place a dummy object under the Marker tracking component, so that it updates its position based on marker tracking
3) Your actual marker content (graphic, character, etc) should be on its own, outside of the Image Marker hierarchy. Let's just call this "Content".
4) A script should disable Content on initialization and then monitor the Marker Tracking component. As soon as marker tracking begins, Content should be reenabled. Whenever marker tracking is occurring, the Content position and rotation should be updated to match the dummy object under marker tracking.
The result of this is that whenever marker tracking is available, the Content will be positioned to match the marker. When marker tracking is not available, Content will rely on device tracking to keep it positioned correctly.
Here's a simple example of this script:
Again, be careful with this because it will only work on devices that support World tracking mode. You may want to fallback to some other behavior if it's not supported.See the Device Tracking API page for a full list of methods available. It will probably look something like this:
Let me know if you have any more questions!
Jacob
Jacob hey man! Is there any way to provide us with a sample project of this working? I can't seem to get the world tracking to work...
THANKS a million