Log in or register to post comments

Adding frame markers at runtime

June 29, 2011 - 8:22am #3

I want to add frame markers to my Unity game at runtime. I made a prefab which is basically the same as the FrameMarker prefab provided by QCAR but with some additional graphics and logic scripts added.

I create the frame markers by calling:
frameObject = Instantiate(FrameMarker, Vector3(0,0,0), Quaternion.identity);
Where the FrameMarker variable is the prefab (dropped onto the inspector window).

When a frame marker is created by calling Instantiate, it creates a game object called "FrameMarker(clone)". No marker is visible in the game scene on the PC. When the frame marker clone is clicked on in the Hierarchy window, it's name changes to "FrameMarker0" (and FrameMarker1, etc.. for additional markers if clicked). Only when the name changes does the frame become visible in the game scene.

The tracking does not work on Android. I cannot "click the game object in the Hierarchy view" on Android, so trying that won't work.

I can't add the frames manually in the Hierarchy. Adding all of them will be too much work.

Any idea how to solve this?

Re: Adding frame markers at runtime

June 29, 2011 - 6:48pm #2

I found part of my answer in this thread:
But the explanation there is incomplete. I unchecked " Marker Synchronization" in the advanced settings and added the config file with 256 markers. But this in itself doesn't solve anything. If I call Instantiate, the behavior is the same as before, namely it does nothing. No tracking.

Presumably I have to call some more functions to register the tracker or something like that. Any help?

Adding frame markers at runtime

October 30, 2013 - 3:25am #1

I know this thread is preatty old, but I have been lately working with FrameMarkers and Assetbundles with Prefabs. One thing that I realized is that the FrameMarkers i.e. do not preserve to MarkerID when saving a changed FM into a Prefab. Have to checked that your changes are stored in the prefab?

Log in or register to post comments