Way to stop player from running into walls

Hello!

I've had a visual bug in my game where if the player holds down the dash key while against a wall, it will display the middle frame of the running animation. I had evented a system that would switch the sprite whenever that key is pressed.
It's not game breaking, but it does look pretty bad.

Is there a way to check if the player is touching a wall?
I thought about using terrain tags, but then it you couldn't run alongside the wall.

Thank you!
Maybe you can check the direction of the player and see if there'a certain terrain tag before him?
Also is it really an issue? Think of every 3D game, you un innto walls and the animation plays, and you can still slide alongg walls and it doesn't look funny or outta place at all. Is it worth so mcuh effort to fix something that everyone else sees as ok annd fine to begin with?
It's pretty easy to check the passability of the tile in front of the player, but it's hard to tell you how to integrate that into your system when we don't know how you're making it change to this other character animation. The basic script call is
Code:
$gamePlayer.canPass($gamePlayer.x, $gamePlayer.y, $gamePlayer.direction())

Also is it really an issue? Think of every 3D game, you un innto walls and the animation plays, and you can still slide alongg walls and it doesn't look funny or outta place at all. Is it worth so mcuh effort to fix something that everyone else sees as ok annd fine to begin with?
I don't think that's a great comparison, since in that scenario in a 3D game you're still moving. @TRIDIUM is talking about walking directly into a wall.

I don't know about "everyone else" - I haven't seen a game do that since, like, 16-bit consoles. I would definitely consider that janky if it were released now.
@TRIDIUM just for context, this glitch happens when the player moves towards a wall? Or also when moving along a wall?
Maybe you can check the direction of the player and see if there'a certain terrain tag before him?
I can give it a whirl. I did event the dashing animation system, so it shouldn't be too hard to add some conditions.

Also is it really an issue? Think of every 3D game, you un innto walls and the animation plays, and you can still slide alongg walls and it doesn't look funny or outta place at all. Is it worth so mcuh effort to fix something that everyone else sees as ok annd fine to begin with?
Yes it is, or I wouldn't be asking.
As I said in my post, the character gets stuck in the middle frame of their running animation, which does indeed look horrible and janky.

It's pretty easy to check the passability of the tile in front of the player, but it's hard to tell you how to integrate that into your system when we don't know how you're making it change to this other character animation. The basic script call is
Code:
$gamePlayer.canPass($gamePlayer.x, $gamePlayer.y, $gamePlayer.direction())
I don't think that's a great comparison, since in that scenario in a 3D game you're still moving. @TRIDIUM is talking about walking directly into a wall.

I don't know about "everyone else" - I haven't seen a game do that since, like, 16-bit consoles. I would definitely consider that janky if it were released now.
Thank you! I'll have to try that!

@TRIDIUM just for context, this glitch happens when the player moves towards a wall? Or also when moving along a wall?
I don't have wall slide, so yes, when the player is right against a wall.
I did event the dashing animation system...which does indeed look horrible and janky.
There, I edited for brevity 😉 🤣

But seriously, if you need any help implementing the above code just show us a screenshot and it should be no problem.

Original thread: https://forums.rpgmakerweb.com/threads/way-to-stop-player-from-running-into-walls.172843/