Need help solving a bug concerning sprit collision boxes and solids.

0 favourites
  • 5 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hello,

    To be blunt I've been trying to resolve this issue with a sidescroller-like game I've been working on for a while.

    https://www.dropbox.com/s/umigmsryttrrmjl/school%20game%20WIP.c3p?dl=0

    currently, my game has a dash mechanic where when you click with the mouse the player character will dash toward the direction that you clicked in, its been quite the ordeal getting this mechanic to work with terrain solids and enemies but I've gotten it to a place I'm satisfied with except for one thing.

    As you can see dashing while on the ground and near a ledge to the left causes the player character to jitter and teleport themselves towards the ledge, as you can imagine having a glitch such as this in a side scroller is not ideal.

    From what I understand the cause of this is most likely a conflict with my "player box" collision box with that of the stage tile map, unfortunately simply deactivating the collision and reactivating it after the dash isn't an option as that makes it very easy for players to get stuck in terrain.

    At this point I'm at my wit's end, I simply do not know Construct well enough to figure out how to resolve this, this is part of a school project so I really want to smooth over this issue as I am proud of how the dash mechanic itself turned out.

    If you guys have any suggestions Id love to hear them, I'd take any advice I can get at this point.

  • I can't see the gif, could you post the direct link to it?

  • ya, I was trying to add it under the post but I believe it was flagged for double posting. seems like it's stuck waiting for mod approval.

    anyways here's the link.

    https://media.giphy.com/media/EPUYnQqiKjoLVEEJF4/giphy.gif

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm not sure about the jittering and collisions, but a bigger problem with your dashing system is that you can't dash to the left.

    Try this:

    Make sure to disable "Set angle" for the PlayerBox on all layouts. You don't want to rotate this sprite, because it has Platform behavior.

    At least this should allow dashing in all directions.

  • So after a bit of tweaking, I think this has fixed all the issues with dashing into the floor.

    from what I could gather the issue was that dashing would rotate the player box collider around the origin point, since the origin was on the bottom of the box (so the sprite wouldn't be sinking into the floor) this caused the player boxes collider to jut out of the play animation collider since the animation collider was in the middle of the sprite. this was fine for dashing to the right as the box collider would jut up and would not run into anything. Still, it seems that when dashing left the collider would overlap with the tile maps collider causing all sorts of chaos depending on how badly it coincided.

    what you suggested kept the player box stationary within the player animation and after some fixes to make sure it didn't poke out at any point it seems to be great now.

    at least that's what I gleaned from this.

    there is still one more glitch with the dash but it seems to be different than this issue so I'll make a new post for it.

    either way, thank you a lot for the help.

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