i need my car to slowly acceleration when i press up and when i let go slowly stop. i dont really understand the variables so if you could be very spacific


acc = 1;
acc = 0;
if (acc)
{
vel += .5;//vel is the name of your velocity variable, or use directional_velocity
}
else if (brake)// if you have a braking key, do a similar thing
{
vel -= 1;
}
else
{
vel -= .4;
}
if (vel < -2){vel = -2;}//limit the lowest speed
if (vel > 20){vel = 20;}//limit the highest speed
Users browsing this forum: No registered users and 1 guest