How do I polish the collision detection?

0 favourites
  • 14 posts
From the Asset Store
Detects any kind of ad blocker. Very easy implementation into already existing projects
  • My goal is to make a small sound play when the character lands on the ground in this 2D platformer. The method I have used is to have two types of platforms: Walls and Ground. The script is set up to play the sound when the character collides with the ground, but not with the wall. However, this has caused some issue with the game detecting when it collides with the ground. For instance, when jumping up and hitting the underside of the platform, the sound will play even though the Ground platform is encapsulated within a Wall platform. This means on paper, no sound should play since only the the top of the Ground platform is exposed, but issues are still cropping up. Can someone help solve the issue or better yet provide a more efficient way of making a sound play when the character lands?

    All help appreciated.

  • it would be a lot easier to help you if you could provide a capx, or at least an image of your event sheet.

  • it would be a lot easier to help you if you could provide a capx, or at least an image of your event sheet.

    Hey man.

    I remember you from the last thread I made. Did the megaupload link not work?

    In any case, I've re-uploaded the capx to Gdrive. Hopefully you can access it.

  • Well this didn't work..

    I got to a link where I had to ask your permission, but the email attached to that request won't work..

    Is there a way to put it in a place where the acces is public?

  • Well this didn't work..

    I got to a link where I had to ask your permission, but the email attached to that request won't work..

    Is there a way to put it in a place where the acces is public?

    Sorry about that, my fault.

    Try this one, says it should be view able by everyone.

    drive[dot]google[dot]com /file/d/0ByYPmF3UV10sVHJqOGcxVjluSkk/view?usp=sharing

  • adding the condition "player is on floor" to the "on collission with solidplatform"- event is a quick solution.

  • adding the condition "player is on floor" to the "on collission with solidplatform"- event is a quick solution.

    Excellent, thanks a lot man.

    Another issue I've been trying to deal with is running into walls while on the ground. The game seems to take it as the character starting a collision with the ground again, and therefore playing the sound. What would be causing this problem and what do you think would be the best fix?

  • Forget the last solution..

    It would actually work a lot better to use the player "on landed" - event

    It's in the platform behaviour animation-triggers, but will work perfectly for this sound-effect..

  • Forget the last solution..

    It would actually work a lot better to use the player "on landed" - event

    It's in the platform behaviour animation-triggers, but will work perfectly for this sound-effect..

    I've changed it for 'on landed' and also included 'is on floor' since the original issue from before was happening. However, the sound will still play when walking into walls while on the ground.

    • Sorry.. noticed the issue returning..
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just noticed:

    You should adjust your collision-polygons..

    They are not completely straight..

  • Also in the first layout a few of the walls are solid platform instead of a wall..

    I used the one on the left of the starting point for testing, but now it seems that one is actually a solid platform, while I was convinced it was a wall

    And Yep - changing that and going back to my first solution fixes it in my capx..

  • Also in the first layout a few of the walls are solid platform instead of a wall..

    I used the one on the left of the starting point for testing, but now it seems that one is actually a solid platform, while I was convinced it was a wall

    And Yep - changing that and going back to my first solution fixes it in my capx..

    I changed the collision boxes of all the objects on the layout so match the bounding box just for testing, but the issue with running into the wall still persists. The sound still plays each time you run into a wall. I'm also aware that not all the walls are actual 'wall' objects. The left part of the level is incomplete and was an older version of the game. The first part of the right side has all the correct objects in the right places.

  • I'm not sure what the problem is, but:

    This works for me

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