ive developed a game that involves applying 2d forces on 2d rigidbody.
It’s very lightweight no performance bottlenecks, so its 60 fps on everything easily.
my timestep is .02 and maximum is .02 as well.
my gravity is -30.
VSYNC enabled.
The game feels fast and correct in the editor and android.
But then i test on iPAD and everything is slow motion!
The rigidbody travels the correct distances based on forces applied but all motion is slow motion.
FPS check says locked 50 fps, not 60 for some reason(i thoughts iOS is only 60,30 and under)
Does ios treat physics scale different from android and editor?
Or is this a bug?
OH MY GOD I FIGURED IT OUT!!!
okay so here’s the deal:
My timestep and max timestep were both .02, I designed my game at 60 fps in the editor, and my android build runs at 60 fps as well.
I have an FPS script that reports fps to me in game BUT it has a flaw which happened on the ipad but i didn’t realize it at first.
Basically the ipad was defaulted to 30fps because i didn’t set Application.targetframerate to 60 fps.
My fps script was reporting 50, which was actually the .02 physics step but i didn’t realize that at first, i thought it meant 50 fps!!!
So i set application targetframerate to 60, and i raised max time step to .04.
My ipad build ran at 60 fps and everything works perfectly.
HOWEVER, i now know that forcemode IMPULSE forces are dependent on TimeStep, at 60fps impulse forces last longer than at 30 fps. Setting max time step to .04 means that if frame rate dips below 50fps the fixed step will start increasing to maintain the same physics game speed, but it will weaken impulse force strength.
Althought my game is super simple so It will never go below 60 fps, I would be very interested in knowing how to make impulse forces frame rate independent. Multiplying by time.deltaTime doesn’t work.