DeltaTime
Tutorial
Beginner
+0XP
5 mins
158
Unity Technologies

Languages available:
1. DeltaTime
UsingDeltaTimes
using UnityEngine;
using System.Collections;
public class UsingDeltaTime : MonoBehaviour
{
public float speed = 8f;
public float countdown = 3.0f;
void Update ()
{
countdown -= Time.deltaTime;
if(countdown <= 0.0f)
light.enabled = true;
if(Input.GetKey(KeyCode.RightArrow))
transform.position += new Vector3(speed * Time.deltaTime, 0.0f, 0.0f);
}
}