How to run step function with arcade physics?

Hello,

I am trying to manually trigger the update step of arcade physics, but I am getting undefined.

In the create I have paused the physics engine by

this.physics.world.pause();

And in the update function, I am calling step:

update(time, delta) {

   this.physics.world.step(delta)

Console logging the step function, I get undefined.
What am I missing here? Thank you in advance!

Can’t you just use the resume function to trigger the update again, after pausing it?

Is the code running without an error?

No, I get an undefined error, when trying to call the step function. Appearently, it cannot be called if the physics.world is paused. What I would like to do is to manually step the execution of the physics engine to have more control over it. Is it possible?

What is the error message, exactly?

My bad, I was console logging the execution of the step function, which being a void function, resulted in undefined.
Now, I have modified the step function, so that it only executes if I am calling it directly. I can run it, but the bodies in the scene don’t update.

1 Like

You are a legend! Thank you! I was using delta as it is! :slight_smile: