Adding Speed
Okay so i have an idea where there is a car and you push the "A" key to add speed, so like everytime you push "A" it adds .5 speed then eventually you're up to a speed of 50 after 100 clicks. My problem is I've put everything else together I just can't fiqure the script out. I have tried a few different things but have had no luck. Any ideas on how to do this?
@Daville17 If you post your script by using the 101010 button I will gladly take a look at it and try to help you with the code. ^~^
Okay so as of now I just have a script to where if you move the left and right arrow keys or the A and D keys the car will move left and right but what I am looking for is for it to start as a speed of zero but every time you push the "A" key it adds .1 to the total speed. This is my Script I have now if that helps any.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class blue : $$anonymous$$onoBehaviour {
float speed = 5.0f;
void Update () {
var move = new Vector3 (Input.GetAxis("Horizontal"), 0);
transform.position += move * speed * Time.deltaTime;
}
}