3 different game speeds

Getting 3 different speeds of my little tester game.

Game runs super slow on mini game view (in Unity)
Game runs fast on max game view (in Unity)
and Game runs super fast when built (in Windows)

weird, any idea what’s happens.
I have disabled v-sync, and put to med setting
I just have a little triangle moving against a starry background

Traditionally when moving you would EITHER:

  • use the physics system and set the Rigidbody’s velocity and forget about it

  • move it yourself (such as in Update()), and be sure multiply the velocity by Time.deltaTime

Both approaches, assuming you’re working within “reasonable” frame rates, will get you vanishingly close to the same results.

2 Likes

Might have to upload a video to explain it better -
getting 3 different version of the game from just using game window default, game window maximized on Play and then building it and playing the Game on full screen.

but will upload a vid, and you’ll see that problem right away

And when I see it, I am sure I will stand by my recommendation.

Are you telling me this because you are already doing one of the things I suggested and it is not working?

hope it is what you are saying

little project will have to be scraped if I can’t sort this out xD
the Unity previews (small)(maximised) vs the build are completely different in game play

I understand what I did, I dunno how to fix though. I changed the Timescale :stuck_out_tongue: and guessing it’s buggered up everything

game was set back to 1 though long time ago.

How are you moving the object? You do not give enough information, particularly the movement code.

Your issue is usually caused by moving objects in Update, but not multiplying by Time.deltaTime. Kurt-Dekker has already given that answer, but you don’t say if you have tried that.

1 Like

As other users have alluded, it sounds extremely likely that you’re moving your objects using a fixed value (a.k.a magic numbers) rather than scaling them using the built-in Time frequency variables. They exist to ensure that if you’re running a different framerates the timing between them is addressable.

If you move an object 10 units every frame update, and you’re pulling 100 frame updates per second, you’ll naturally move at a different speed if you’re only pulling 30 frame updates per second.

Multiplying your movement speeds by Time.deltaTime is a good way to ensure that even if you’re only getting 5 frame updates per second your movement is still consistent.

Also, for the love of people’s GPUs, please consider using something like Application.targetFrameRate. It’s a good way to try and keep your game running at a consistent update rate without making people’s graphics card spit out 300+ fps unecessarily. You should still target Time.deltaTime for all scalable / time-sensitive values though.

Thanks for the help and feedback! I have done all what you suggested, and cheers Kurt, helped very much!
And I’ll look into Application.targetFrameRate.

1 Like