Log in or register to post comments

question about animations that start on tracking

May 23, 2012 - 5:28am #1

Hey,

So we have several scenes where an animation begins when tracking begins. In other words, we have an imported .ma file and an AudioClip that both get started simultaneously when tracking begins, kind of like:

TrackingStart() {
transform.animation.Play("animation_name");
audioSource.Play("clip_name");
}

We notice that the animation an audio are often not in sync. However, once the animation is loaded, if we press a Restart button that essentially calls the same function, then the animation and audio are in sync. For instance:

RestartButtonPressed() {
TrackingStart();
}

Any thoughts as to why this may be?

Re: question about animations that start on tracking

May 23, 2012 - 7:41pm #5

It sounds like contention between the initial animation and audio buffering. Have you profiled the app, or simply checked the FPS count during this process?

Also when you've tested Restart, has the parent object already been enabled by OnTrackingFound? - wondering whether the Renderer activation is initiating at the same time as the audio and animation.

This may be a good question for the Unity forum or answers.unity3d as well. There's nothing happening under the hood w/ Vuforia that would offset the audio play.

Re: question about animations that start on tracking

May 23, 2012 - 1:02pm #4

Actually, no, I take that back. It may be a Vuforia issue... perhaps something is happening the first time there is tracking that is causing a bit of a hold-up?

Re: question about animations that start on tracking

May 23, 2012 - 12:45pm #3
patch24 wrote:

Just curious if you've tried (instead of putting it in start) calling your reset button function directly after a brief pause through a coroutine? Maybe there should be a small pause to let things catch up after the tracking starts..

Thanks for your reply. Yes, I've tried that. It doesn't matter if you don't wait, or if you wait 5 seconds. The first time the animation plays, the audio lags a bit. Weird. So now I'm thinking this is just a Unity issue...

Re: question about animations that start on tracking

May 23, 2012 - 10:33am #2

Just curious if you've tried (instead of putting it in start) calling your reset button function directly after a brief pause through a coroutine? Maybe there should be a small pause to let things catch up after the tracking starts..

Log in or register to post comments