-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unknown Force is applied on some vertically stacked cubes on straight plane? #177
Comments
Yep this seems to be a known issue for cannon.. I'd love to see a fix as this is a pretty prevalent issue |
Is there an alternative solution to fix this unexpected behaviour? I read about using sleep or downgrading versions. Did that really work? |
@prathamVaidya sleeping the body seems like the only realistic way to get around it. Since you still want gravity to apply, what you could do is add a collision listener to the cube. When it collides with another cube, call cubeBody.sleep(). This will stop it from jittering. (Also make sure to use cubeBody.allowSleep = true when you initialise the body) |
One solution you could try is the "sleep" feature (see the sleep demo). In my case, I had to set sleepTimeLimit to 0 and sleepSpeedLimit to 0.1. It worked perfectly. |
Check out the Video Proof
When three simple cubes are stacked together vertically, after some time the cube experience a force to the left direction. I checked the plane is not rotated at y or z axis. Am I missing something obvious or its just a bug in CannonJS?
The text was updated successfully, but these errors were encountered: