question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v0.18.0 introduces major bugs with collisions with sleeping bodies spamming collisionEnd indefinitely

See original GitHub issue

Upgraded 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:open
  • Created 2 years ago
  • Comments:20 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
tropicalpuddingcommented, Jan 11, 2022

@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

1reaction
landgreencommented, Jun 28, 2022

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/ )

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found