0 Favourites

"On collision" and "On overlap"....

  • I am trying to make a test of a platformer with physics. However I am having trouble getting the character to jump. It jumps okay when no conditions are imposed, only the "press button" one. But I need to stop the character from jumping in air. I thought I would do this by checking if it's in contact with the "ground" and if so, let it jump, however I am using the "overlap" condition to check this, which for some reason it's not working. The player it's clearly overlapping the ground, C2 for some reason does not think so. I thought I would then use "on collision" instead, but the problem persists. Is this a problem with physics?

    Also, why can't I invert "On collision"?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • you should add another little "sensor" sprite (without physics behaviour this time) attachet to the bottom of your main character sprite, then check for "onOverlapping" between sensor and the ground/objects

  • you should add another little "sensor" sprite (without physics behaviour this time) attachet to the bottom of your main character sprite, then check for "onOverlapping" between sensor and the ground/objects

    Yeah I guess so. -__- I was trying to avoid this scenario, but I guess it's the only work around. I still wonder why this is happening though.

    Thanks a lot. :)

  • What if you used the "Overlap at Offset" condition? You could say if player is overlapping the collision object at Y:+1.

    "The 'offset' variant will test for an overlap at an offset from the first object. For example, testing for an overlap at an offset of (100, 0) will temporarily move the object to the right 100 pixels, test for the overlap, then move it back again."

  • boolean: at the time of the previous last post of this thread, the condition "overlap at offset" wasn't yet implemented in C2 (a year ago).

  • what the...the post date says 2011. Why was it on the first page? 0_o

    edit - I just noticed I responded to another thread that is from February. Where are all these old posts coming from?

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