-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Body properties are incorrect after switching from static to dynamic #1301
Comments
See this Stack Overflow snippet for another reproduction of the issue. The snippet is currently running 0.19.0. When the box hits the static platform, the platform falls when struck by disabling static with |
Just ran into the same issue with version 20. I saw that the |
For users upgrading from version 0.19 to 0.20, some code may exhibit unexpected behavior and break. You can try this const textBody = Matter.Bodies.rectangle(
pivotX + textWidth / 2,
pivotY,
textWidth,
textHeight,
{
isStatic: true, // remove this
friction: 0.8,
frictionStatic: 0.9,
restitution: 0.4,
density: 0.001,
}
);
Matter.Body.setStatic(textBody, true); // add this |
@hylarucoder Surprisingly, that does seem to make a difference! Nice find. Nonetheless, the behavior of the falling body is still quite a bit different (and less desirable) in v.20 relative to v.19. It may be a different issue, but if you apply that |
After updating to the latest version (0.20.0) i have an issue where when i switch my body from static to dynamic with
Matter.Body.setStatic(ball, false);
it disappears. When looking at the body it seems like the values of its properties are set incorrectly. The body seems to be still there because the collision logic still triggers. I think the body just shoots off outside of view.When adding the body with
isStatic: false
it spawns and behaves as it should.I really don't know where to go from here.
Here is a basic example of the issue:
The text was updated successfully, but these errors were encountered: