lag, deltaTime & box2d - any advice?

So I’m fairly confident with my understanding of delta time and modifying movement so objects get around in respect to time instead of frames. I’ve applied this to my “handcrafted” physics with good results

To apply this to box2d physics do I just run something like the following on an enterFrame listener?
 

physics.setTimeScale(deltaTime)

Or maybe Box2d is already configured in some way to manage time based movement?
I found with the line above things maybe seem more “jerky”…

Thanks in advance - I did have a quick look around but couldn’t find too much relevant information.

All that physics.setTimeScale() does is adjust the speed at which the physics simulation runs. 

What you want is https://docs.coronalabs.com/api/library/physics/setTimeStep.html 

 

Thanks I have just been playing with that… I presume it’s not something you just set once and leave it to Box2d.When I update it every frame based on delta… yes it keeps things moving relatively normal even when I overload the engine.

However just when things would otherwise be smooth sailing, using the setTimeStep seems to create a pretty jerky result. For instance after I simplify the scene down until it’s buttery smooth… messing with setTimeStep every frame seems to have a detrimental effect. It’s only slight but noticeable. Weird.

All that physics.setTimeScale() does is adjust the speed at which the physics simulation runs. 

What you want is https://docs.coronalabs.com/api/library/physics/setTimeStep.html 

 

Thanks I have just been playing with that… I presume it’s not something you just set once and leave it to Box2d.When I update it every frame based on delta… yes it keeps things moving relatively normal even when I overload the engine.

However just when things would otherwise be smooth sailing, using the setTimeStep seems to create a pretty jerky result. For instance after I simplify the scene down until it’s buttery smooth… messing with setTimeStep every frame seems to have a detrimental effect. It’s only slight but noticeable. Weird.