- Home /
Question by
EliteHedgehog56 · Nov 09, 2018 at 05:11 AM ·
physicsaccelerationvehicle
add acceleraction to ship controls
I am making a F-Zero style futuristic racing game, anyway I have this basic script set up for my player ship with turning and moving
var speed : float = 10.0;
var rotationSpeed : float = 100.0;
function Update () {
var translation : float = Input.GetAxis ("Vertical") * speed;
var rotation : float = Input.GetAxis ("Horizontal") * rotationSpeed;
translation *= Time.deltaTime;
rotation *= Time.deltaTime;
transform.Translate (0, 0, translation);
transform.Rotate (0, rotation, 0);
}
But at the moment it stops and goes instantly, I want to add acceleration to go with the speed variable and better braking to the script , how would I achieve this?
Comment
Your answer
Follow this Question
Related Questions
Acceleration and Inertia in Top-Down 2D Game (C#) 2 Answers
How do I make a first person player get in a vehicle? 0 Answers
Vehicle Won't go past 2nd gear. 1 Answer
Why won't my car start? 2 Answers