The system you posted does not fully utilize UE5’s built in movement and input system, meaning it is over complicated and will cause you more headache than it’s worth.
I recently created a project for someone else on this forum for them to learn from, I will share all of its details with you here so you can do the same
Create a new top down project and navigate to here, mine is modified and will be different from yours, mine is set to work for using WASD or arrow keys for moving, yours is set up to move the character with clicks.
All of these IA’s (Input actions) are utilized here, in the IMC. The IMC (input mapping context) is a collection of IA’s that you can assign to a player controller or player controlled pawn/character.
You should learn ALL of the options under value type drown down in the IA
In the IMC, you can see the IA’s all here. Feel free to create/add more. You should learn about the negate modifier in the IMC
The IMC is applied to the player controller here
And then added to the player controller with this code
This gives you access to new events that trigger on your input, these triggers are based on the settings you configured in the IA and IMC.
If you need any more help, feel free to ask
Tip about movement component
You should generally always use the character movement components that are provided by UE5, whether it be characters, or pawns. Modifying/creating movement components is way, way too much work. Leave modifying this to experts in the field (decades of experience to be honest), we can achieve everything we need without doing this for practically any game
And do not worry about your character going through walls at the moment, it sounds like you are not using the proper movement component base that UE has provided, all the things it does for us is too complicated to explain in anything less than a book