By denyscarlino
on Tue, 07/11/2017 - 16:02
Hello Community,
im desperate and thats why im posting here. I followed several tutorials but i didn't get any solution and thats why im here now
I use the Vuforia Framework and Im trying to implement a virtual button to rotate my 3D Model.
After putting the Virtual Button, which is a child of my image target, above the image target, i don't get "button pressed" in the console, when i "hit" the button
in play mode. I renamed the virtual button to RotateZombieButton.
Is this enough information or do i need to provide more information?
thanks in advance!
using System.Collections;using System.Collections.Generic;using UnityEngine;using Vuforia;public class VBScript : MonoBehaviour, IVirtualButtonEventHandler {private GameObject VBButtonObject;void Start () { VBButtonObject = GameObject.Find ("RotateZombieButton"); VBButtonObject.GetComponent<VirtualButtonAbstractBehaviour> ().RegisterEventHandler (this);}// Update is called once per framepublic void OnButtonPressed (VirtualButtonAbstractBehaviour vb) { Debug.Log ("Button pressed");}public void OnButtonReleased (VirtualButtonAbstractBehaviour vb) { Debug.Log ("Button released");}}
Hello denyscarlino,
Hello denyscarlino,
The sample project contains a scene demonstrating the use of virtual buttons. You can get the sample on the Unity Asset Store or on our webpage: https://developer.vuforia.com/downloads/samples
Thanks,
-Vuforia Support
Type your code in the box.
Type your code in the box. To create a new line within the box use SHIFT + ENTER. Hello,
this doesn't help me!
Please is there somebody to help me i google all day every day to fix this but no help
So this is my code:
Looks like your zombie object
Looks like your zombie object is null when you press the button. Make sure it exists in the scene and is being assigned to your variable properly.
Thanks,