Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by jason7262 · Jul 29, 2013 at 10:45 PM · vuforiaaugmented realityrealityaugmentedqualcomm

Vuforia Virtual buttons question

When i add virtual buttons to my project I write a script for it, assign the script to the ImageTarget, Test it and nothing happens when i hover my finger over the Virtual Button it does nothing at all.

Heres my script:

 using UnityEngine;
 using System.Collections;
  
 public class VirtualButtonEventHandler : MonoBehaviour, IVirtualButtonEventHandler {
  
     char x;
     char a = 'a';
     
     public GameObject Keyboard;
     public GameObject Text;
     
     // Use this for initialization
     void Start () {
         
     Keyboard = transform.FindChild("Text").gameObject;
         
  
     }
     
     public void OnButtonPressed(VirtualButtonBehaviour vb){
         
         Debug.Log ("Pressed");
         GetComponent<TextMesh>().text = "test";
     }
         
     public void OnButtonReleased(VirtualButtonBehaviour vb){
         Debug.Log("Released");
     }
     
     void Update () {
         
     }
     
 }


Please tell me the problem or give me a tutorial because there are no tutorials on the Qualcomm website that tell you how to do it.

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image PaulzCreative · Feb 11, 2015 at 07:28 PM 0
Share

For NOOBS the documentation is not at all clear here what needs to be entered from a base level of functionality.

From what I gather it shows how to dynamically create a button and perhaps how to register it, all in one code block....

Not all of us necessarily want to create it dynamically since some of us might not be at that stage yet.... or we have it already created it in the editor and we only want the code necessary so we can simply drop the action we want done into it like slipping bread into a toaster, man.

For me I don't always understand the code samples until I put something relevant into it then I can dig deeper to understand it better.

So those...." heres the code block...." and "Insert ACTION HERE" are perfect for noobs.

The example in the Vuforia documentation is terribly written and leaves alot of new developers walking away with a sour taste in their mouths when its actually pretty easy! this will be attempt number three for me. Im not walking away till I understand it and can use it effectively. Any help and CLARIFICATION or SI$$anonymous$$PLIFICATION would be helpful.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Jamora · Jul 29, 2013 at 10:51 PM

You need to read the Dev Guide section for Vuforia. Especially the documentation for Virtual Buttons in Unity.

From a quick skim, it would seem that you're not registering your button handlers to the Vuforia event handler. Place this code in your Start method. I assume your virtual button behaviours are also names vbb, as that's how it's like in their site....

 // Register an event handler
 // Here we assume this class extends IVirtualButtonEventHandler
 vbb.RegisterEventHandler(this);


Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image jason7262 · Jul 30, 2013 at 07:21 AM 0
Share

On the website it doesn't tell you how to do something when the button is pressed

avatar image Jamora · Jul 30, 2013 at 07:27 AM 0
Share

Only you know what you want your buttons to do, so the Vuforia pages won't help there. Once you know what you want your buttons to do, you put the implementation inside the OnButtonPressed -function.

You get the Vuforia AR system to call your OnButtonPressed function by subscribing to the Event handler in the ImageTargetBehavior script. It's all in the links I posted.

avatar image PaulzCreative · Feb 11, 2015 at 07:44 PM 0
Share

Ok so EXACTLY WHERE DO WE PUT THIS???? Does it go inside the event handler or prior to it? does it go in the declarations?

Total noob here... i know common sense says prior... but NOTHING tells you WHERE to... so frustrating.

Some one please provide the complete code

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

17 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Extended tracking in unity using vuforia model target? 2 Answers

how can i create a count down AR object that depends on a variable of remainnig stock? 1 Answer

AR target detection + obtain 3D camera position + gyroscope control 0 Answers

Limiting rotation along Y axis in vuforia 1 Answer

Can we bypass the vuforia sdk? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges