using System.Collections; using System.Collections.Generic; using UnityEngine; public class ball : MonoBehaviour { float movementSpeed=5.0f; int num = 3; string output= "Gem numbers = 3"; // Rigidbody ufo1; // Start is called before the first frame update private Rigidbody rb; void Start() { // ufo1 = GameObject.Find("UFO").GetComponent(); rb = GetComponent (); } // Update is called once per frame void Update() { float x1 = Input.GetAxis("Horizontal"); float z1 = Input.GetAxis("Vertical"); rb.AddForce (x1,0f,z1,ForceMode.Acceleration); } void OnTriggerEnter (Collider other) { if (other.tag == "Picker") { Destroy (other.gameObject); } } }