R49 : [Platform Behavior] - IsOnFloor (won't fix)

0 favourites
  • 4 posts
From the Asset Store
Wanting to do a Shot n Run game easily? Here is your chance!
  • Seems IsOnFloor doesn't work correctly when the sprite has frames with different sizes. The sprite collides on floor , isOnFloor is true, the next frame it returns false, then true , then false, then true etc...

    So it appears IsOnFloor is moving the sprite up and down indefinitelly.

    Example: A sprite has an animation with two frames one with 52px height and another with 49px height. When it collides in one frame IsOnFloor returns true than it changes the frame IsOnFloor is false , then true , then false and so on. If i force it to stay on frame 0 for example it works correctly. Hope my description is clear enough

  • Are you sure it is a bug ?

    Seems pretty obvious to me though, since you are changing a 52 px high image to a 49 px image. There is a 2 px difference, putting the sprite (hotspot is still the center) 1 px above the ground, so not in collision with it.

    Do having some "Y tweaker" on a "animation frame changed" event resolve this ?

  • I don't think we can or should fix this.

    Even in Classic, using animated sprites as your platform object is notorious for causing unintended problems. The usual thing to do is have an invisible solid square representing the player, which does not animate, and you position your animating player on top. Otherwise, you end up with lots of complicated situations like: you're standing next to a wall, the animation frame changes, and now part of your character is embedded within the wall. This kicks off Construct's 'push out of solid' code, which usually works but sometimes doesn't do quite what you wanted (your player may teleport a short distance or appear to "glitch").

    So even if we fixed this, you're still going to have problems if you use the animated sprite with a platform movement. For the record, 'Is on floor' works by pushing the player down 1 pixel and seeing if it overlaps a solid there, so if your player's bottom edge raises it won't count as on the floor any more. (If you could change hot spots, you could also fix it by having the hot spot at the bottom-middle edge.)

    So I think this should be resolved "won't fix".

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok, fair enough. For some reason i forgot the collisor technique, my bad. Thanks

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