Help with Vuforia project

Moved from answers: http://answers.unity3d.com/questions/585960/

I created this thread for tredpro.

He needs a lot of help with his project, more than Answers can support, so I am moving the discussion here.

So, First off, tredpro, please describe your project.

What are your outcomes? That is, what is your project supposed to be when it is finished? What is the purpose of the finished project? How/Why does your audience use it?

I’ll update this post as we get more information.

You are suppose to put a card down and 2 things appear using vuforia. 1st is the monster in it’s idle position and 2nd is an attack button. you press the attack button an the monster attacks and then goes back to idle position.

Ok, that is kind of what I imagined. Where is your project at so far? Is any of it working?

all but getting it to attack

Oh, so you already have the button? Are you using OnGUI() for the button?

I have a button that i created with a plane. I went with that because i wanted the button to only show up when the image target is visible and so it will follow the image target

Do you have it setup to trigger when it gets pressed?

no

Do you have the button appearing only when you want already?

If so, how are you toggling it?

Yes the button already appears when the image target is visible. all i have to do is make it a child of the ImageTarget just like i did with the 3d model

Do you know how it does that, deactivating/activating the GameObject?

no i don’t

i think it is in this code

also i have been trying to go the raycast route but i can’t get a working code

Ok, I got a much better way to go.

Can you find the “DefaultTrackableEventHandler.cs” file and paste the source in here for me.

That is music to my ears right now!

Is there an instance of that attached to you trackable image gameobject?

If so, then that is what is controlling the child objects.

yes that is attached under the inspector of the ImageTarget

how will i make this happen? and will i use the previewanimation script you game me before?

Ok, So, we are going to replace the DefaultTrackableEventHandler.cs with a custom TackableEventHandler.
First, create a copy of the DefaultTrackableEventHandler.cs file and place it somewhere outside the Vuforia library in your assets, so we know it didn’t come with the Vuforia package.
Then, rename it to something like TrackableEventHandler.cs and rename the class in the file to the same thing, minus the “.cs” of course.

check