I am make a game that is similar to Super Monkey Ball Deluxe and I need a countdown timer and once that timer runs out the level restarts. I have been looking around for a while and cant find anything. also if anyone can help me with my terrain controller it would be much appreciated.
Currently I’m using this code:
using UnityEngine;
using System.Collections;
public class TerrainController : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
float z = Input.GetAxis("Horizontal") * -15.0f;
Vector3 euler = transform.localEulerAngles;
euler.z = Mathf.Lerp(euler.z, z, 50.0f);
transform.localEulerAngles = euler;
float x = Input.GetAxis("Vertical") * 15.0f;
Vector3 reuler = transform.localEulerAngles;
reuler.x = Mathf.Lerp(reuler.x, x, 50.0f);
transform.localEulerAngles = reuler;
}
}
on a cube that you can’t collide with or see and making the cubes the ball rolls over a child of that object, however, it is very jumpy and you can glitch through the floor quite easily.