v0.18.0 introduces major bugs with collisions with sleeping bodies spamming collisionEnd indefinitely
See original GitHub issueUpgraded from v0.17.1 to latest to hopefully see some performance upgrades. Verified performance is pretty much the same but there is a nasty bug introduced if you have Engine enableSleeping
true. Bodies that collide with sleeping bodies will have Matter.Events.on collisionEnd
spammed indefinitely until you restart the server. It’s pretty easy to reproduce.
This issue will likely happen more frequently than expected to anyone using Engine enableSleeping
true as it’s quite difficult to manually manage sleeping bodies when you want and not have the lib auto sleep everything including static bodies, this is due to sleepThreshold=-1
being so difficult to set in a manner that sticks, but that is an unrelated older usability issue.
Issue Analytics
- State:
- Created 2 years ago
- Comments:20 (8 by maintainers)
Top Results From Across the Web
Sleep Disorders as a Cause of Motor Vehicle Collisions - NCBI
Fatigue as a result of sleep disorders, excessive workload and lack of physical and mental rest, are known to be major contributors to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@liabru I have also been seeing this bug the past few days. In my instance I have a game where when a body collides with another particular static body, the first body will be set to sleeping then removed after a set amount of time. What I am noticing is that the collide end event will continue to fire even after the body is removed from the world. I set up a code pen to demonstrate:
https://codepen.io/tropicalpudding/pen/LYzgaXK
I wanted to report that I has similar issues with sleeping collisions when I switched to 0.18 I just tried the alpha build from here and the problem went away. So I can also confirm the fix, thanks!
(the issue for my game occurred when you use an ability that freezes time for everyone but the player called time dilation, https://landgreen.github.io/sidescroller/ )