How to limit object or application speed?


If I have moving objects in my game and the player PC runs the game faster than mine, it makes the objects moving faster. If the player PC runs the game slower than mine, it makes the objects moving slower. To solve this problem I know about 2 method. One is to use DeltaTime to set object speed. This way the object is moving at the same speed, (as on my PC), don’t matter how fast the game runs on other PCs. The other method is to set or limit the entire game speed (FPS). This way don’t matter how powerful the PC, the game runs at the same speed on every PC (of course if it meets the minimum requirements).

I remembered I have seen somewhere DeltaTime() function in GameDevelop, but now I want to use it to set speed like “200*DeltaTime()” but GD and the expression editor don’t recognise this function it say syntax error and the object don’t move. Now I’m confused about do I have seen this function before or not or Am I use it wrong way :confused:

Anyway, anybody could help me with this?
Is there anything I can (I have to) use in GameDevelop to limit or set speed of objects or the entire game?


1 Like

Note that forces and timers are already independant from the computer speed

I knew I have seen something :laughing:

Thanks :slight_smile:

Sorry for digging up old post. But how do you fix the fps to a certain number? Say, 30.

You can’t, at least not yet, you can modify the project.json file to set the minimum fps, though: [url]GDevelop games on extremely slow devices?]

Fixed FPS is going to be investigated soon, to help games running the physics engine :slight_smile:

Thanks again!!!