Hi all,
I have a problem with my unity script. I'm trying to make a virtual button so I can rotate my cube. I have an error popping up and I just don't know how to fix this. First I thought it was some kind of spelling error but that does not seem to be the case I think... Any ideas? This is my code:
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Vuforia;
public class vbButton : MonoBehaviour, IVirtualButtonEventHandler
{
public GameObject vbBtnObj;
public Animator cubeAni;
// Use this for initialization
void Start()
{
vbBtnObj = GameObject.Find("LacieBtn");
vbBtnObj.GetComponent().RegisterEventHandler(this);
cubeAni.GetComponent();
}
public void OnButtonPressed(VirtualButtonBehaviour vb)
{
cubeAni.Play("cube_animation");
Debug.Log("Button Pressed");
}
public void OnButtonReleased(VirtualButtonBehaviour vb)
{
cubeAni.Play("none");
Debug.Log("Button Released");
}
}
↧