UI Button for AR content using Vuforia
Hi Friends,
i am making some content on Vuforia AR SDK, and want to add UI button (Not the Virtual Button) on which i want to load new Level, i have very less knowledge of programming ( null) tried to search some of the tutorials most of on the Virtual button, can anybody please help me with the coding or if have any tutorial or resource link please suggest
Answer by michelle12188 · Dec 12, 2016 at 12:05 AM
With Vuforia you should be able to just add one of the Unity UI buttons to the scene and assign a function to it. It should work fine.
Make a script with a function similar to this:
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class ButtonBehaviours : MonoBehaviour {
public void LoadScene(string sceneName)
{
SceneManager.LoadScene(sceneName);
}
}
On the UI button there should be a place to add an OnClick. Put this script in the project and wherever you need a button to load a scene add this function to the button.
To assign it to the OnClick: Click the plus icon -> drag in the object that contains the script -> select YourScript->LoadScene()
it worked Great thanks but how can i face that button to interface even if the AR cam is moving
Answer by Shekhark · Dec 12, 2016 at 02:48 AM
Do i need to add any touch event for The button to work on iOS and Android
Your answer
