If you increase the “Fixed Timestep” form 0.02 to 0.01 then the energy of the object will increase considerably.
Reading other links I made an experiment. I put a ball and let it fall down by gravity at default 0.02 Physics fixed time step.
Then i change the fixed time step to 0.01 (100fps) then the ball falls much faster (in 2D).
I was not expecting this effect since the manual talks about physics quality. It did not mention changes in mass or weight . It did not mention that if we change the timestep then we will need to change the gravity , all the masses and the joints, etc.
Is it a bug? It looks more like a conceptual bug. If i set up gravity at 9.8, I expect that the engine calculates correctly the acceleration, no matter if i change time steps to calculate that info.
I do not get it. Can you please put more info about ?
The problem is a boundary global box Collider 2D all around the game. If I turn it off, the physics speed of the game works as expected. If all the physics game objects are inside this Collider following the tutorial instructions (making-angry-birds-style-game) the speed of the physics it became frame rate dependent. So strange.
If you are not multiplying your force values, and you double the speed, you are applying double the force. What is your goal with increasing the fixed time? is it to speed up gameplay?
forceValue * Time.fixedDeltaTime should make it frame rate independent enough for your needs.
I increase Fixed time to 0.01 to get 100 frames per second. Since by default is only 0.02 (50 frames per second) and my camera moves in fixed updates because follows the game object with a rigidboady attach to it. I’m researching fluidity. The problem was that passing from the default 0.02 Timestep to 0.01 , the game was much faster. Just using gravity. Looks like the collider in the collider do not work as expected. Now i Import one more time Unity angry-birds tutorial and the default scene given by Unity works well. Yes there is something in my code that affects physics updates as if it is working in normal updates. I’m trying to isolate the bug to understand if is my error or a combination of colliders and code conversion. Clearly the problem is when the 2D physics is working inside a collider boundary.
The big box collider 2D that is use as boundary was not trigger
When [ Is Trigger = false ] the physics inside this box collider acts as if it is in update instead of fixed updates and my game was not working properly. Now Is trigger = true and all works fine.
Game smoother. My real frame rate was over 120 frames per second and the perception physics was 50 frames per second. So I increase the physics frame rate up to 100 frames per second changing time step. Now my visual frame rate is closer to my physics frame rate.
ok, so, rather than increasing the physics time step, I would move your camera movement code into Update. Should be able to smooth that out easier and you wont be working the engine as hard.
Increasing the timestep may make it look like its running better, but tbh, you’re just putting a bunch more pressure on the system to perform, which means (especially on low end devices) it will run poorly. I’ve never had a problem with the default physics step. Increasing it is only advised when you need more accuracy because everything is happening really fast (like car racing games).
Yes i’m at 350kmh. The game is made for PC. The default option was good using 0.02 and the option Interpolate active. But i want to push it more just in case for having extra margin to take out.
And then let the player or my system change it via code in the game if the frame rate is poor.
You are the best man! I spend 2 days on fixing enemy jittering with rb.AddForce and pixel perfect camera (render texture based). I understand that problem was is not synced movement between enemy and player + camera (because player and camera works good) even if movement code is equal. But you help me fix this in 1 step, just adding fixedDeltaTime in AddForce, when everybody tells that DeltaTime already in it. After fixing all objects on scene move synced because movement not depend on frame rate now and there is no difference and no jitter. Grateful!