Question by
Jakesitos · Oct 01, 2016 at 07:48 PM ·
componentaugmented-realitysliderdisabledeactivate
Slider to disable Augmented Reality,Slider Script, Disable script camera
Hi, I'm doing a project Augmented Reality by running the Accelerometer like a gyroscope. I made a Slider that activates and deactivates augmented reality. But many scripts did not work to clear it, any ideas please? The script to move the camera with the accelerometer is in the camera, what I want is that with the Slider the script is turned off. Camera Script:
using UnityEngine;
using System.Collections;
public class Acceleration : MonoBehaviour {
public float Speed = 10f;
public void Start () {
}
// Update is called once per frame
public void Update () {
transform.rotation = Quaternion.Euler (-Input.acceleration.z * Speed, 0, -Input.acceleration.x * Speed);
}
}
Comment