Log in or register to post comments

How to check if child of image target showed

June 11, 2013 - 3:33am #1

Hi, there !

I still bit confused with vuforia ar, when I try to play animation my objek if child of image texture show up?

the animation start play when the application start, not when the my objek showed. I cannot find the code that tell the image target showed

Sorry for my bad english, thank you

How to check if child of image target showed

August 30, 2017 - 10:53am #14

Thanks big time

How to check if child of image target showed

October 13, 2015 - 9:48am #13

BIG THANKS..

How to check if child of image target showed

September 24, 2015 - 11:03am #12

Thanks for  the tip! This solves my problem. This works in Unity 5.2.1.

How to check if child of image target showed

November 10, 2014 - 11:39am #11

My cube animation, does not start, after image target found, can u help me?

How to check if child of image target showed

May 30, 2014 - 3:39pm #10

YES !! Big thank's to you !!

How to check if child of image target showed

September 5, 2013 - 2:06am #9

Good to hear, and thanks for sharing.

N

How to check if child of image target showed

September 4, 2013 - 7:55pm #8

Hi,

I found the fix. This has to do with the rig section of the FBX model. Please choose 'Animation Type' to 'Legacy' and 'Generation' to 'Store in Root(New)'. The model will play the animation when detected using the code posted in this thread. I am using  Unity 4.1.5f1. 

Thanks,

BP.

How to check if child of image target showed

September 4, 2013 - 5:02am #7

Sorry, this is not really anything to do with Vuforia, although I did provide the original script that could help some developers.

You will have better luck over at the Unity forums, because playing / handling the FBX that is imported is more a Unity issue.

 

N

How to check if child of image target showed

September 4, 2013 - 4:49am #6

Hello,

I am having few issues in getting the FBX file animated. The model is paying the animation in the preview pane (Please see the attachment). I also added the script mentioned in this thread. How can I fix this issue?

Thanks,

-BP

AttachmentSize
Image icon 01.png44.67 KB
Image icon 02.png119.98 KB

How to check if child of image target showed

September 3, 2013 - 5:12am #5

You would put this instead of the Animation part.

Try it out and see if it works, if not then read up a bit more and try something else.  Should not be too hard.

 

N

 

sounds play OnTrackingFound

September 3, 2013 - 5:01am #4

hello in unity scripts.. ImageTarget. im trying to copy and paste the codes on this post.but i dont know where to put play and stop audio code? please help me..can you give a simple way scripts..thank you..

How to check if child of image target showed

June 11, 2013 - 10:48am #3

WOW you rock Nalin !

I do not know that the functionality was already there, I should have been more careful in reading the code of your plugin

Thank you for your help !

I will try tomorrow, now time is 00:47 AM in Indonesia, I have to rest

How to check if child of image target showed

June 11, 2013 - 5:27am #2

When you import the animation into the scene as a child of the image target you need to make sure that the checkbox that says "Play Automatically" is unchecked.

I cannot find the code that tell the image target showed

This code is in the DefaultTrackableEventHandler.cs event handler script which is attached to each Image Target and contains code to enable and disable it's children when tracking is found and lost:

 

    public void OnTrackableStateChanged(

                                    TrackableBehaviour.Status previousStatus,

                                    TrackableBehaviour.Status newStatus)

    {

        if (newStatus == TrackableBehaviour.Status.DETECTED ||

            newStatus == TrackableBehaviour.Status.TRACKED)

        {

            OnTrackingFound();

        }

        else

        {

            OnTrackingLost();

        }

    }

 

...and as an example when tracking is found, the children are turned on.

In order to add playing of an animation I have extended the code as per below:

 

    private void OnTrackingFound()

    {

        Renderer[] rendererComponents = GetComponentsInChildren<Renderer>();

        Collider[] colliderComponents = GetComponentsInChildren<Collider>();

 

        // *** Additional animation code

        Animation[] animationComponents = GetComponentsInChildren<Animation>();

 

        foreach (Animation component in animationComponents)

        {

            component.Play();

        }

        // *** end of animation code

 

        // Enable rendering:

        foreach (Renderer component in rendererComponents)

        {

            component.enabled = true;

        }

 

        // Enable colliders:

        foreach (Collider component in colliderComponents)

        {

            component.enabled = true;

        }

 

        Debug.Log("Trackable " + mTrackableBehaviour.TrackableName + " found");

    }

 

 

Hope you find this useful.

 

N

 

 

 

 

 

 

 

Log in or register to post comments