You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
320 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Runner : MonoBehaviour {
public float speed=0.01f;
public float acceleration = 1f;
void Update () {
if (speed < 1f) {
speed += acceleration*Time.deltaTime;
}
transform.position += Vector3.forward * speed;
}
}