- Home /
Things moving too fast only after Application.Load
Sometime's when my game switches scene's, for example, from the main menu to a worldmap things will be moving in hyper-drive, its as if Time.timeScale was notched up, but I have checked and it remains at 1. this is very noticeable because I have textures scrolling across the background, I'm designing a 2D game using Orthello.
Here is the relevant code in my scrolling script. I'm beginning to think this this is a bug in 3.5.5 and I am as we speak upgrading to 3.5.7 hoping that will fix the issue, but somewhere deep down I doubt it.
void Start () {
translate = new Vector3(-scrollSpeed * Time.deltaTime , 0, 0);
}
void Update () {
if (startToScrollAt < Time.timeSinceLevelLoad)
Scroll ();
}
void Scroll () {
this.transform.Translate (translate);
}
Could you debug scrollSpeed as well, just to make sure that's not accidentally getting changed somewhere? It sounds like that might be reverting to a default of some kind.
Is the issue only with assets preserved across the new scene load? Could you be getting one or more large deltaTime slices during the switch? That is for the existing assets time may still be running, but Unity is busy. It is possible that sooner or later those assets will get either a large deltaTime, or several smaller ones to bring time up to date?
thanks robertbu, that fixed it. I changed Scroll() to this so it gets a new time.deltaTime every update
void Scroll () {
this.transform.Translate (new Vector3(-scrollSpeed * Time.deltaTime , 0, 0));
}
Your answer
Follow this Question
Related Questions
Weird double-tap bug when I use standart controller (Android) 0 Answers
Why is unity lagging so much? 1 Answer
Unity Editor's Inspector Glitch while using OnGUI function 0 Answers
Weird Placement Glitch 0 Answers
Tartan plaid flannel background in editor while scrolling through zoom levels 0 Answers