AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
TestCameraMovement.cs
Go to the documentation of this file.
1 using System.Collections;
2 using System.Collections.Generic;
3 using UnityEngine;
4 
5 public class TestCameraMovement : MonoBehaviour {
6  private Rigidbody rb;
7  private float speed = 2;
8 
9  // Use this for initialization
10  void Start () {
11  rb = this.GetComponent<Rigidbody>();
12  }
13 
14  // Update is called once per frame
15  void FixedUpdate () {
16  float moveHorizontal = Input.GetAxis("Horizontal");
17  float moveVertical = Input.GetAxis("Vertical");
18 
19  Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
20  rb.AddForce(movement * speed);
21 
22  }
23 }