How do I write a 'fixedupdate' in script2?

How do I write a ‘fixedupdate’ in script2?
I wrote in the same way as script1, but it did not work.

Rotate.prototype.fixedUpdate = function(dt) {

I tried the following, but it also didn’t work.

Rotate.prototype.fixedupdate = function(dt) {

Rotate.prototype.Fixedupdate = function(dt) {

Rotate.prototype.FixedUpdate = function(dt) {

In addition, I could not find out in the API reference.

Please tell me how do I write it.


fixedUpdate doesn’t exist in the new scripting system. Can I ask why you need it?


Because, I had heard that fixedUpdate is good for physical operation.

I don’t need to use fixedUpdate in playcanvas?

No, you can happily use the regular update function and the physics simulation works just fine.

Wow, it sounds great!
I’ll change to write the codes on my project to script2.:slight_smile:

Thank you.

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?

You could implement a fixed time step yourself. Here’s a good article on how to do so

So just use the regular update method and do the time accumulator as described in the article.

1 Like

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 =;'update', rigidbody.onUpdate, rigidbody);
app.on('my-fixed-update', rigidbody.onUpdate, rigidbody);