unity5 - Virtual Button Vuforia scripting


Keywords:button 


Question: 

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Vuforia;

public class fullscreen : MonoBehaviour, IVirtualButtonEventHandler
{

    private GameObject vbButtonObject;

    // Use this for initialization
    void Start()
    {
        vbButtonObject = GameObject.Find("fullb");
        vbButtonObject.GetComponent<VirtualButtonBehaviour>().RegisterEventHandler(this);
    }

    public void OnButtonPressed(VirtualButtonBehaviour vb)
    {
        Debug.Log("1");
    }
    public void OnButtonReleased(VirtualButtonBehaviour vb)
    {
        Debug.Log("2");
    }

    // Update is called once per frame
    void Update()
    {

    }
}

This is my codes for a project when I try VirtualButtonAbstractBehaviour instead of VirtualButtonBehaviour it's underlining it like there is a typo. My virtual button not working please help.


1 Answer: 

Just make sure the AR camera is on the image target It works for me !!! enter image description here