I have a global time scale that affects the entire scene. However, I have one object, an animation called “SuperPowerUp”, that I want to be unaffected by this time scale. I want this object to always have a time scale of 1, regardless of the global time scale.
In order to make “SuperPowerUp” maintain its original speed, I created the action ‘‘Change the animation speed scale of SuperPowerUp: set to 1’’. However, when I do so, it stays following the value of a global variable I have called ‘‘SpeedCoefficient’’.
What I want is for “SuperPowerUp” to be independent and always set to 1, even when I change the value of ‘‘SpeedCoefficientInput’’ which is a Text Input.
Does anyone have any suggestions on how I can achieve this? Any help would be greatly appreciated!
Thank you for your suggestion! It worked perfectly. However, I noticed that when I set the time scale of the scene to around more than *4, the speed of the scene doesn’t seem to increase further. Do you know why this might be?
Thanks for your reply. To troubleshoot the issue, I’ve removed all events related to the SpeedCoefficient . The only action I’ve left is the Set the time scale of the scene to. However, the problem still persists.
Thanks for your suggestions. Unfortunately, the issue still persists. I noticed that when I set both the time scale of the scene and the world time scale of the ball to a high value, the ball launched upwards doesn’t reach the expected summit. Instead, it turns back towards the surface and the speed does not seem to increase further.
For more context, I’m using a game template from GDevelop. Here’s the link to the template: https://gdevelop.io/game-example/free/spherez.
I appreciate any further insights or suggestions you might have on this issue.
I tried the example and set both timescales to 20 and I got the same result as you.
I believe that the physics engine don’t handle a high timescale well, the gravity is being multiplied by 20, but other forces seem to not be calculated correctly. I also noticed that setting the timescales back to 1 (releasing the speedup button) makes the ball move very slowly.
Maybe that’s a bug in the physics engine and setting the physics timescale to a high number messes up all the calculations? I’m not really sure.
I tired setting the gravity of the ball to 0, which fixed the ball falling back down when sped up. BUT the problem of the ball slowing down afterwards is still there.
I think you don’t need the physics time scale for your example and only setting scene timescale to a high number works just fine. The physics seem to speed up / down without any problem.
Can I ask why you want to adjust the time scale so much? Wouldn’t it be easier and better to leave the time scale and change the force and/or physics settings. It seems like the scene is a balancing act. It’s tring to maintain a frame rate while timing and syncing various things.
Im not criticizing it. I’m just trying to understand it.
Thanks for your detailed response and for testing the game. I agree with your observations about the physics engine . However, I’ve noticed that even when I set the time scale of the scene to a value greater than 4, the speed of the scene doesn’t seem to increase further. This happens regardless of the physics timescale or the gravity settings.
I appreciate your suggestion. I’m still a beginner in using GDevelop. While I’ve tried changing the force and/or physics settings as you suggested, it has led to some bugs in the game. As a beginner, troubleshooting these bugs can be quite challenging. That’s why I’m experimenting with the time scale instead.
Turns out that the physics engine locks the speed of a moving object with max speed of 1200. Even when setting high timescale, the rest of the scene (animations or other non physics objects) move at the set timescale, but physics objects are calculated separately and never travel faster than 1200.
Since the example project shoots the ball at speed of 300, 1200 / 300 = 4. So the ball can never speed up more than 4x. It’s a limitation of GDevelop’s physics engine.
I think you only have these 3 options:
Accept that you can’t speed up more than 4x.
Shrink down the project to smaller resolution like 180x320 (1200 max speed will be 4x faster at this resolution) but you’d have to redo all the assets / fonts to pixel art and change the forces.
Recreate without using physics.
If the balls are moving at a very high speed, collisions might not work properly. The balls may skip the blocks and collisions wont be detected.