Fixed_update called regardless of physics.use_fixed_timestep

the fact that fixed_update(self, dt) is being called regardless of the state of physics.use_fixed_timestep seems correct to me because it is conceptually unrelated to physics. one might want to use it for non-physics related stuff as well, like for netcode or solving simulation with iterative methods.

it’s just that the manual (Writing game logic in scripts) and the autogenerated comment when creating a script says otherwise.

so I think it’s just the outdated documentation but thought I’d ask to be sure

You’re right. The documentation is incorrect. Fixed update will be called if engine.fixed_update_frequencey != 0.

The script file template has been updated to reflect this (Update template.script · defold/defold@d8c558b · GitHub) and the documentation has also been changed (Update script.md · defold/doc@79ef5da · GitHub).

Thanks!

6 Likes