- Home /
The question is answered, right answer was accepted
(2D) Game runs faster when quality is set to low
Hi,
So I'm experiencing a problem where my 2D game is speeding up as I lower the quality of the game (Through the launcher or In-Editor; Project Settings > Quality). This is something I can't seem to fix on my own except for leaving some unnecessary settings, like anti-aliasing, on.
Does anyone know what might be causing this problem?
-Martin
I had this problem as well- basically if the game runs faster (more fps), then some function you call such as transform.translate or any transform will be faster because it is called every frame. I think you can use a fixedUpdate or lock the fps.
Answer by Dave-Carlile · Apr 27, 2016 at 03:12 PM
I assume you mean your game objects are moving faster, not just a higher frame rate...
When moving things you need to do that in a frame rate independent manner. You can do this by doing updates in the FixedUpdate method which is always called at a consistent rate regardless of display frame rate. Or you can multiply values by Time.deltaTime before applying them to game objects so the movements are scaled by the frame speed.
For example, if you want an object to move at 10 units per second on the x axis then adding 10 * Time.deltaTime to x will make it move at that rate since deltaTime is the elapsed time in seconds for the previous frame.
I want to add Time.deltaTime is extremely useful for frame rate independent program$$anonymous$$g in Unity and worth understanding. It is useful in many aspects of 2D program$$anonymous$$g with Unity (try it with angles and scale factors when doing manual animations!).
Follow this Question
Related Questions
Sprite quality is very poor 3 Answers
Game running at different speeds on different quality levels. 1 Answer
How do you pause or set speed of Animator layer/state? 2 Answers
How to limit my player speed (2D)? 2 Answers
Issues with 2d movement 2 Answers