# Strange conveyor behaviour

## Recommended Posts

Hello all,

I just started experimenting with the great Babylon framework. I am trying to mimic pallets (1.2 * 1.6 * 0.8 m, 1000 kg) running on a conveyor belt behaviour by setting a linearVelocity to an object without mass which then acts as the conveyor.

See this demo: http://www.babylonjs-playground.com/#11KWUR#7

But i am running into a problem, related to the velocity. I am setting a velocity of 0.25 m/s (line 53) and the "conveyor" is 10 meters long (line 46). This means it should take about 40 seconds to cover that distance. But as you can see from the demo the speed is approximatly 1 m/s since it only takes 10 seconds to cover the distance. The issue is not related to friction, to illustrate I have added an other 'pallet' with low friction.

Can somebody explain the behaviour to me? And how can I fix this?

##### Share on other sites

Weird

One option could be to set the time step to a lower value:

##### Share on other sites

Hi @Smek,

you had me at "the great Babylon framework".

This is rather werid, yes. I have to say - the timestep solution is the quickest and the safest for you to simulate the right behavior. As babylon only acts as a proxy to the real physics engine (which, in this case, is cannon.js), it will be wise to see what cannon is actually doing with the information. I will try finding a bit of time later today and debug this a bit, see what we are doing wrong.

##### Share on other sites

I looked at it some more, for some reason the real velocity is a factor 0.33 compared to the real thing.

I fixed it (for now) by setting the time step to 1/180 instead of 1/60 and the gravity to 3 times -9.81. But I think this is something to look at since users are probably expecting the same units as both physics engines use.

##### Share on other sites

Found the actual problem, Babylon is calling 3 substeps in this line:

this.world.step(this._fixedTimeStep, this._useDeltaForWorldStep ? delta * 1000 : 0, 3);

This causes the problem.

Good catch!

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.