How do I handle Is Overlapping with Custom Movement Speed

0 favourites
  • 5 posts
From the Asset Store
Run and Jump in 3 Dimensions! Take your platformer to the next level!
  • I have two major issues that I simply cannot seem to figure out how to handle, but it's possible solving one might help me solve the other.

    Note that I am NOT using Physics, this is a Top-Down view, similar to the SNES Link to the Past game.

    On my Player object I am using CustomMovement to move the character around. So let's say if Left button is down then Set CustomMovement Horizontal speed to 200, and on release Stop. If the player overlaps a Wall sprite then I currently have the playerr push out of solid (Nearest).

    The problem with using Push out of Solid (Nearest) is that Construct 2 apparently decides that this means to move the Y coordinate constantly down ever time it pushes onto the left side of the wall, the X coordinate moves to the right if pushing onto the bottom of the wall, and Y coordinate moves up if pushing onto the right side of the wall. This causes the player object to keep sliding around the object until it slides off the edge it's pushing against. Oddly enough, pushing onto the top of the wall doesn't have this problem.

    I've attached an example capx of what I mean, showing what happens when you push into the left side of the wall.

    Is there a way to handle this? My actual goal is to have the Player object "collide" with the wall and stop, however if I just use the CustomMovement Stop this prevents the player from ever moving again since he is still overlapping the wall object by 1 pixel so the event is always firing.

    The couple "How do I" posts I've come across don't speak to this issue, so hopefully someone has figured this out and can help.

  • I think using 8 direction would make things easier for you in this case , but if your adamant about custom movement i would play around with the stepping features of the behavior .

  • Ok, using 8-direction movement seems to be able to handle collisions a lot better. Thank you for the idea to swap to that instead.

    Since the game is going to have a lot of parts where the player has to push another object, as well as enemies, is it better/easier to handle them with 8-direction movement or use Custom Movement for them? If I use custom movement I'll still have the issue with the objects being pushed sliding along solid objects. The enemies I am already handling via Custom Movement fairly well so far, but they are very basic enemies right now.

  • Read up on overlap at offset , used in conjunction with 8 direction i think it won't be difficult for pushing and or pulling , i have used it with 8 direction as well as platform movement .

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That worked perfectly! Thank you so don't understand how frustrated I was getting with this and was almost at the point of just quitting thinking C2 couldn't handle this simple thing I was trying to do.

    It's good to know it was just me not understanding all of C2s capabilities and how some of the behaviours/functions worked.

    This has solved every single issue I had. Everything is now working exactly how I need it to and I can move on with the rest of my game

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