using System.Collections;
using System.Collections.Generic;
public class Ball : MonoBehaviour {
rb = GetComponent("Rigidbody") as Rigidbody;
if (Input.GetKey("up")) {
if (Input.GetKey("down"))
if (Input.GetKey("left"))
if (Input.GetKey("right"))
Debug.Log("You have " + coins + " coins.");
void OnTriggerEnter(Collider other) {
if (other.gameObject.name == "Coin")
Destroy(other.gameObject);
if (other.gameObject.name == "Jumper")
if (other.gameObject.name == "EndZone" && coins >= 5)
UnityEngine.SceneManagement.SceneManager.LoadScene("End");