Answer the question
In order to leave comments, you need to log in
How to speed up a 2D game in Unity over time?
Good day. There is a movement script:
using UnityEngine;
public class MoveObject : MonoBehaviour {
[SerializeField]
private float speed = 5f;
private void Update()
{
if (transform.position.y > 6f)
Destroy(gameObject);
transform.position += new Vector3(0, speed * Time.deltaTime, 0);
}
Answer the question
In order to leave comments, you need to log in
well, you can use Coroutine, where you just write a delay of 10 seconds, after which you increase the speed by 1.
You can simply enter a time variable of the Float type, and if it is not equal to zero, subtract Time from it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question