Hi @Will im in need of a fixed update, because im working on a game that is not using the regular physics.
So when on some devices the ticks go beyond what they should, breaking my pseudo physics, how can i implement fixed update?
Hi, thanks for the link, but i don’t think i understand the code, what is “integrate()” ?
I you could briefly describe how to use this in playcanvas i would highly appreciate it :C
Hey! Is there any plan to bring fixed update back? It was supremely helpful for me since I tend to do a lot of physics modifications. I come from Unity and used it all the time there
Unfortunately, there are no plans at this time. The update and physics update tick is tied to the browser requestFrame. So if you want to update the physics, you can use the standard update call
There is actually a difference between normal PC update and a fixed update. Depending on what you do with physics in update method, there may or may not be a divergence in physics simulation on high frame rate screens vs normal 60 fps. The link above is a good example on how you can implement your own fixed update event. If you have a divergence, you can switch to your own event.
You can unsubscribe rigidbody component system from the regular update method and subscribe it to your custom fixed update, something like:
const system = app.systems.rigidbody;
app.systems.off('update', rigidbody.onUpdate, rigidbody);
app.on('my-fixed-update', rigidbody.onUpdate, rigidbody);