Help with player collision

0 favourites
From the Asset Store
Players follower. use it for anything which follows the player
  • I'm having some trouble regarding collisions in a prototype I'm working on. I've managed to get the controls feel exactly as I want them, but when it comes to interacting with solids it just goes crazy, particularly thick ones. Here's a link to the prototype so you can see what I mean: http://www.newgrounds.com/projects/games/868367/preview

    I just can't seem to wrap my head around how to stop this from happening! Sorry about the vagueness it's just I'm not sure sure how to explain the issue.

    Here's a link to the .capx: https://www.dropbox.com/s/uxfi81x659915 ... .capx?dl=0

    Thanks for any help, totally stumped on this one!

  • do you mean when the player bumps into the brown wall?

  • jobel Yeah. The biggest problems are when you can glitch through the thicker ones and the rapid increase in speed when you slide across it. Though, tbh, none of its working well

  • the only glitching I see is when you are touching more than 1 solid at a time.. otherwise it seems solid.. (no pun intended)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • jobel Dare say I'm flattered! Did you not notice that if you hit a horizontal ledge just right you can either stick to it or be shot up? Maybe I'm noticing it more because I've tested it so much but its still happening.

    Were you on mobile or desktop btw? Noticed it more on desktop myself.

  • desktop.. yes you shoot up the side, I just thought that was because I had my mouse up..didn't really notice it. but now that you mention it...

    I noticed you have the camera lerping inside fly=1 or fly=0.. I think that should be outside of that logic and should always be happening - meaning the camera should always follow the player no matter what logic happens..

  • jobel Ah that good, I'm not just going crazy then haha.

    The camera is because I want to experiment with a more active camera that shows more in front of your flying up and more bellow if your flying down. Just not got around to playing with it yet.

  • I've been messing around with it... I think it's because of your Waypoint.X The code is still trying to get to the X over and over and is trying to get through the solid..

    I noticed it depends on how far over you click which determines the speed of which it shoots up the right side, or shoots down the left side

  • I would suggest using custom-movement instead of lerp, but if you want it your way, I guess this is the best solution..

    https://dl.dropboxusercontent.com/u/485 ... owEsc.capx

    By the way, you might want to put your sprites (especially the walls) on pixel coordinates instead of inbetween pixels..

  • By the way, you might want to put your sprites (especially the walls) on pixel coordinates instead of inbetween pixels..

    is that why there's sometimes overlap? I was wondering that..

  • in addition to LittleStain 's solution, I would have the Waypoint.X expire after a certain amount of time..or something like that..

    because if you Touch/Click way across the screen, when you come off the wall (after sliding down it) the player goes rushing over. So maybe OnOverlap Wall you shut off the Waypoint.X lerp logic..

  • Added a pixel to the player displacement to prevent player being stuck and added setting waypoint.x to player.x to prevent the rushing..

    Re-upload at the same adress..

  • Thanks jobel LittleStain that's fixed everything but the wall jump issue. I've made a quick gif: http://i61.tinypic.com/1zd7iq9.gif

    Really have to time it right for that to happen mind you but its still possible. Though it does only work when I move the mouse off the screen so possibly only accepting an x coord between a certain size?

  • well the further you click away the faster the player moves along the X... so it must be redrawing it inside the wall since you aren't using a behavior like CustomMovement, meaning it's happening before the other behavior logic.

    so yes limiting the x to a certain amount may work.

  • That makes sense, the % that it jumps with the lerp becomes enough to clip through a wall when the WaypointX and player.X become so large. I'll also give custom movement an experiment too as I've not tried it yet. Though it doesn't work with solids does it?

    Thanks again, hopefully I'll have this nailed soon!

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