Why my topdown 2D character slows down when running diagonally along a wall ?

Another question:

When the character is running alongside the TOP and BOTTOM walls, is the issue the same, but shifted? Where they only slow when LEFT + UP/DOWN or RIGHT + UP/DOWN are pressed?

If so, then you can have a condition like:

  1. When player is against a VERTICAL wall, disable ← and → .
  2. When player is against HORIZONTAL wall, disable ↑ and ↓.

You can place a BOOLEAN between your X and Y inputs that gate-checks for any OVERLAP EVENTS.

You can place a COLLISION BOX around your character, and when that box comes in contact with a wall it will adjust the BOOLEAN value.

You’ll just need to make sure your walls are blueprinted to be HORIZONTAL or VERTICAL.

1 Like