- Home /
game speed in the car tutorial track
Hi, I face a problem in a car driving game.
I make my own engine of car, and it works great on simple scene with terrain and mountains. Correct speed, correct steering, wheel rotation - all is ok. But when i take this car with my script, and put it on the track from Car Tutorial, it start's to behave to fast. Speed of driving is increased about x2, steering also are to fast. So could you explain to me, is there any option in unity engine that increases/decreases speed of game? or explain me why car on the complete track moving so fast?
Thank you for answers; buckyouf.
Answer by DragonSaige · Aug 26, 2012 at 03:48 PM
Hmm.. so you basically want to slow the game itself down? Here's what you can do.
Javascript:
function Update(){
Time.timeScale = 0.5;
}
C#:
using UnityEngine;
using System.Collections;
public class DragonSaige : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
Time.timeScale = 0.5f;
}
}
Time.timeScale is used to manipulate time , by setting it to 0.5 the speed is halved. When Time.timeScale is set to 1, real time speed gets turned on.
EDIT:Please note that using Time.timeScale slows down the ENTIRE game instead of just slowing down your car's speed
Your answer
Follow this Question
Related Questions
How make breaks and maximum speed 0 Answers
Question about the speed in the cartutorial 0 Answers
How can i rotate my car steering wheel in accordance to the wheels? 1 Answer
Reduce steerangle at high speeds 1 Answer
Void loop? 2 Answers