Time.deltaTime regulates the time between the previous and the current frame. Basing behaviour like animations on frames can lead to unpredictable results, because framerates can vary in different devices or different times in the game. Time.deltaTime allows for more natural movement, based on real time, and not frames.
This property regulates the time between the current and previous frame, deltaTime gives natural movement, based on real time and not by frames.
public class movement : MonoBehaviour {
private Transform myTransform = null;
public float speed;
void Start() {
myTransofrm = GetComponent<Transform>();
}
void Update() {
myTransfrom.position += new Vector3 (0, 1, 0) * speed * Time.deltaTime);
// +1 x, y, z
}
}
public class movement : MonoBehaviour {
private Transform myTransform;
public float speed;
public float rotation;
void Start() {
myTransofrm = GetComponent<Transform>();
}
void Update() {
myTransfrom.Translate(Vector3.forward * speed * Time.deltaTime);
myTransfrom.Rotate(Vector3.up * rotation * Time.deltaTime);
}
}