[r173] Physics "Disable Collisions" bug

Bugs will be moved here once resolved.

Post » Sat Jun 28, 2014 8:01 pm

Hey Ashley, hope you are well!

Problem Description
So I've been compulsively checking my code to figure out why something is going a bit wrong with my physics events, but I've managed to nail down whats going wrong (Pretty severe problem in my scenario :( )
If you have a 2 physics sprites which are the floor and a box, if the box lands on the floor and you disable physics collisions, the box will not fall through. So I thought, Maybe the box is "sleeping"? So I apply a small amount of Impulse upwards to 'wake' it up, but if the impulse is small enough, the box will still collide with the floor. It seems that you need to get the box far away from the floor before it will disable collisions.

Attach a Capx
https://dl.dropboxusercontent.com/u/776 ... litch.capx

Description of Capx
So here is what I explained above. The box is getting Impulsed upwards slightly, every 0.5 seconds. Not much to explain really except the steps to reproduce.

Steps to Reproduce Bug
  • 1. Run the capx
  • 2. Wait for the box to land on the floor before doing anything.
  • 3. When the box is on the floor, notice that it is bumping upwards every 0.5 seconds. This is good, goes up, back down, collides with ground.
  • 4. Click "Disable Collisions", and you'll notice that nothing seems to happen, even though the object is not asleep or anything. It should be falling through the floor.
  • 5. Click "Higher Jump" and now you'll see the box fall through the floor.

Observed Result
Box doesn't disable collisions when called.

Expected Result
Box shouldn't collide with floor as soon as it is called.

Affected Browsers
  • Chrome: (YES)

Operating System and Service Pack
Windows 7 64-bit

Construct 2 Version ID
r173, haven't got round to updating just yet but it'd be funny if this wasn't even in r174. :P

Thanks for checking this out!
Posts: 571
Reputation: 9,819

Post » Sun Jun 29, 2014 1:42 pm

I got the same problem since r168. Maybe earlier.
Posts: 421
Reputation: 6,543

Post » Mon Jul 07, 2014 2:20 pm

Closing as won't fix. This isn't to do with Construct 2, it's something to do with the internals of Box2D's collision detection, which is not something we can easily change I'm afraid. Perhaps you can work around by destroying and recreating objects and swapping them with objects with no physics behavior?
Scirra Founder
Posts: 25,198
Reputation: 200,327

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 0 guests