Disabled collision still triggers sometimes

0 favourites
  • 5 posts
From the Asset Store
Game Triggers is as versatile as a Swiss army knife, and will be a great resource for any type of game you're creating.
  • Link to .capx file (required!):

    dropbox.com/s/4rw0vov3g7pycki/Collision%20Bug.capx

    or:

    docs.google.com/file/d/0B6SE3iNEz3tAS1Y1NHNZWlZWUzA/edit

    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.

  • 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.

  • 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:

    youtube.com/watch

    Please let me know what you think \ any ways around this.

    Thanks

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)