Wall-sliding help

I was wondering can anyone help me out with my wall-sliding & wall-jumping system?

To elaborate, for a while now I’ve been working on a wall-sliding/wall-jumping system that works like the Mario games & I’ve managed to get almost everything working except for one major feature.

super-mario-bros-wonder-wall-jump

You see currently in my project, wall-sliding automatically activates when the player is in contact with the wall while not touching the ground.

Instead what I want is for wall-sliding to only initiate if the player pushes the directional input of the controller in the same direction as the wall that the player wishes the player character to cling to.

Whereas if the player doesn’t press the directional input while the player character is making contact with the wall then nothing happens and player character will simply fall to the ground as normal.

This is how it works in the Mario games and its what I want to emulate in my own game, which necessitates re-working my current wall slide coding:

The problem though is that I don’t know how to make the directional input work which is why I need help.

So I tried making an attempt at gating off the wall slide/wall jump unless the player has pressed the right direction button but to no success.

The problem right now is that the gating doesn’t work, meaning that the player character can freely wall slide/wall jump without any direction input just like how it worked before I reformatted everything.

Everything I’ve tried to fix this issue either does nothing at all or prevents the player from wall sliding/wall jumping altogether with no in-between.

I just don’t know what to do, especially since they’re no tutorials online for wall sliding/jumping that covers this topic despite it being a component of wall sliding/jumping in commercial video games like the modern Super Mario games.