Bernie Roehl

Bernie Roehl

I want to have an object displayed on a target, and when I touch the object I want to replace it with another object.

Seems simple enough. I create a Trackable2DObject with its drawable.cam set to be the first Model, and I add an onClick() handler that does a removeCamDrawable() and an addCamDrawable().

The result, however, is a bit strange. It displays the first object, but when I click on it, it simply disappears and the second object is nowhere to be seen. However, when I look away from the target and back again, the second object appears! It's almost as if the removeCamDrawable() worked, but the addCamDrawable() was somehow postponed.

Both models will be added to the trackable2dobject during creation. One model is disabled (.enabled = false) so it won't be rendered. On a user click the first model is disabled and the second model enabled.