Log in or register to post comments

How to create virtual buttons in unity3d

May 2, 2011 - 3:20am #1

i have read the virtual buttons dev guide but not getting exactly how to implement those through unity. Can anyone help ??

Re: How to create virtual buttons in unity3d

June 30, 2011 - 3:15am #9

hi ,
i am back. I have a new problem i am trying to add menu in my application which is been integrated in eclipse and its not happening through OnCreateOptionsMenu() function. How can i do that ??

Re: How to create virtual buttons in unity3d

May 5, 2011 - 4:51am #8

You'll need to implement the ITrackableEventHandler interface to get this functionality. Open any of the samples and take a look at Scripts/TrackableEventHandler.cs for a sample implementation that includes OnTrackingFound and OnTrackingLost methods.

- Kim

Re: How to create virtual buttons in unity3d

May 5, 2011 - 4:24am #7

Hey kim thanx.

But now with this 1.0 version i am not able to find OnTrackingFound and OnTrackingLost methods.

Are these functions replaced by some new one??

Re: How to create virtual buttons in unity3d

May 4, 2011 - 5:21am #6

It sounds like you are mixing old Beta 2 code with the new 1.0.0 code. IImageTargetEventHandler has been replaced by IVirtualButtonEventHandler, and TrackableScript has been replaced by TrackableBehaviour. Don't try mixing the old and new scripts, instead delete the entire Qualcomm Augmented Reality folder and import the new one. See the upgrade guide for more details:

http://ar.qualcomm.at/node/2000420

- Kim

Re: How to create virtual buttons in unity3d

May 3, 2011 - 11:20pm #5

hey kim thanx . i found the virtual button prefab.
but now i am getting an error that

"Assets/Qualcomm Augmented Reality/Scripts/IImageTargetEventHandler.cs(12,33): error CS0246: The type or namespace name `TrackableScript' could not be found. Are you missing a using directive or an assembly reference?"

I dont know why its coming i have this TrackableScript in my scripts folder. how to resolve this??

Re: How to create virtual buttons in unity3d

May 3, 2011 - 4:48am #4

The prefab is part of the QCAR-1.0.0.unitypackage. It is located in the Qualcomm Augmented Reality/Prefabs folder.

- Kim

Re: How to create virtual buttons in unity3d

May 3, 2011 - 12:08am #3

thanks kim.
But i have seen that sample app example but in our unity 3d i dont have this virtual button prefab. how to get that?

Re: How to create virtual buttons in unity3d

May 2, 2011 - 6:42am #2

There is Unity-specific documentation for Virtual Buttons on the SDK main page: http://ar.qualcomm.com

Getting Started - Unity Extension > Step 3: Mastering Advanced Topics > Using Virtual Buttons

Basically, you can drag the VirtualButton prefab onto an existing ImageTarget in your scene. Size and position the Virtual Button to your liking. Then, implement the IVirtualButtonEventHandler to handle the OnVirtualButtonPressed and OnVirtualButtonReleased callbacks. Drag this script onto your ImageTarget as well. Take a look at the VirtualButtons sample application for a sample implementation and setup.

- Kim

Log in or register to post comments