How do I detect the floor?

0 favourites
  • 7 posts
  • (Sorry for my bad english) In my 2d platform game I got a jump animation that is set to play only when the player is not on the floor. My "floor" is made of collision boxes which I gave the solid behaviour, even when the player lands on the ground the jump animation continues. I don't know why horizontal collision boxes are not recognised as floor. I also tried stopping the animation and playing the idle one when the player starts falling but this way it's the idle animation that goes on forever even when I run because the game always thinks the player is falling even if it's standing on a collision box.

  • Not sure the exact cause, but a couple suggestion.

    1. Check your collision polygons (sometimes they start with bizarre shapes).

    If that doesn't help

    2. Check your "condition" (on collision, is overlapping, etc.) you might need to add a distance if the collisions are not happening as you like (or use an offset, etc.)

  • Link a screenshot of your events or your project file. It's hard to help without seeing what you did.

  • This is the code related to the jump animation "ID_SALTO", with this code, the jump animation goes on forever, even when running.

    This is how the animation is set up

    And this is an example of a collision box.

    With this code, the jump animation goes on forever, even while moving.

    If I were to set it up like this the animation would end only when running (the runningg animation is triggered)

  • Post a snip of the character collision polygon please.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Using is on floor is not the best way for this..

    You have a condition trigger: On Jump

    Use, on jump set animation to ID_SALTO

    You can also use Is Jumping to compare and set your animation..

  • Only way I could solve the problem was by adding a wait action and then setting the animation to the idle one (ID_FERMO), I guess i'm ok with that but I still don't get why the "on floor" condition doesn't work.

    This is the collision polygon for the animation ID_SALTO, it's the same for both frame

    Either way thanks a lot for the help

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