Disabled collision still triggers sometimes

Bugs will be moved here once resolved.

Post » Fri Apr 05, 2013 11:01 pm

Link to .capx file (required!):
https://www.dropbox.com/s/4rw0vov3g7pycki/Collision%20Bug.capx?n=63142990
or:
https://docs.google.com/file/d/0B6SE3iNEz3tAS1Y1NHNZWlZWUzA/edit?usp=sharing

Steps to reproduce:
1. Left click to restart layout
2. Use the mouse to move the blue square
3. Try and cross the yellow line and hit the red square
4. It should not be possible to move the red square
5. Move slowly so the blue square is still in contact with the yellow line as it touches the red square and it seems to still have collisions enabled most the time.

Observed result:
Sometimes (Not sure if it is due to the speed / random) it is possible to still make contact and move the red square. The counter in the top right still works (Says collisions should be disabled) but they still work.

Expected result:
Blue square should pass through the red one. As soon as the position of the blue square is further to the right than the yellow line, collisions are disabled and never turn back on unto restarting the layout.

Browsers affected:
Chrome: yes
Firefox: not installed
Internet Explorer: yes

Operating system & service pack:
Windows 8

Construct 2 version:
r124 beta. Although I have tried it on the 123 version before I updated and it was the same.

Many thanks. Maybe it is a misunderstanding I have with physics properties as I am new to construct.
    Mayfly2013-04-05 23:03:32
B
32
S
9
Posts: 156
Reputation: 3,521

Post » Mon Apr 08, 2013 4:11 pm

Closing as not a bug: you need to make sure collisions are disabled further in advance. If the objects are already touching when you disable collisions, the existing collision is not disabled. (This is how Box2D works; we can't change it.) There seems to only be a few pixels distance between when collisions are disabled and the edge of the red object, so if you move the mouse fast you can make it collide before the collisions are disabled.
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Post » Mon Apr 08, 2013 7:10 pm

Hi,
I seem to disagree although hopefully you can prove me wrong and I can fix my game. I have moved the squares further past the line which disables collisions. I can still replicate this 'bug'. Even if I pause the blue square on the line (and hence collisions should be disabled from then on) I can wait, and sometimes move and make contact with the red square. I have not worked out what makes it leave collisions enabled \ disabled. Maybe it is to do with slowing down / keeping same velocity?
I have uploaded a video clip to show this:

http://www.youtube.com/watch?v=mk0MZ6cpfhQ

Please let me know what you think \ any ways around this.
Thanks
B
32
S
9
Posts: 156
Reputation: 3,521

Post » Wed Apr 10, 2013 9:48 pm

I've been experimenting with this to try and figure what is causing this strange behavior. I have notice that if when I turn the collisions off, I also set the speed to 0 (for both x and y) then I cannot make contact past the line. You also cannot notice this as the square is controlled by the mouse, so it seems to be a fix for this issue. I would however like to try and fix this for when the objects are moving as bouncing balls, so using this way around wouldn't work as I'd stop the balls completely.
B
32
S
9
Posts: 156
Reputation: 3,521

Post » Sat Apr 13, 2013 1:55 pm

I think the problem is 'disable collisions' takes a tick to take effect. If I move the 'disable collisions' action to 'Start of Layout' I definitely can't reproduce the problem. I think this has to be closed as it's all happening inside the physics engine, and you can't disable collisions just before actually colliding, since it hasn't updated yet.
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests