artoolkitx / arunityx

artoolkitX for Unity, providing high-performance video acquisition, marker and texture tracking and full Unity Editor support
https://www.artoolkitx.org/
Other
41 stars 22 forks source link

Animation OnMarkerLost #31

Closed dburongarcia closed 1 year ago

dburongarcia commented 4 years ago

Hello, I'm trying to add animations to the AR content whenever the tracker is lost. I managed to make the events OnMarkerFound and OnMarkerLost work. I even managed to make the animation work for OnMarkerFound, but it seems OnMarkerLost freezes the content.

Is there any way to make an animation of the AR content trigger when the marker is lost? I have tried with both ARToolKit5 and ARToolKitX.

dburongarcia commented 4 years ago

I made a "hack" and OnMarkerLost call a coroutine that waits 0 seconds to reactivate the AR content, then perform the animation and onComplete deactivate the content again. That creates a small flicker, but at least it works.