Disabling smooth character sliding along walls in first-person view.

Translated into English using Google Translate; errors and misunderstandings are possible.

When using the standard character movement component with Enhanced Input and Add Movement Input

, a first-person character walking into a wall at a shallow angle slides perfectly along it, with velocity dropping to very low values ​​(like 0.xx). I want to achieve movement similar to Resident Evil 7, where the character effectively “sticks” to the wall when moving into it from any direction and cannot push further into it. To move again, the player must either press one of the other movement keys or turn the camera away from the wall. I’d like to know how to implement this. You don’t have to write the entire system—just pointing me in the right direction would be great. Ideally, I’d like to use Blueprints, but I’m open to C++ if necessary. I hope I’ve explained the question clearly.

There are some plugins provided by epic or 3rd parties i don’t remember exactly that help do this. A simple system is to use a line trace and calculate the distance between the player and the wall, make sure the line trace goes forward depending on the direction. You can then use a curve float and multiply the value depending how close the player is to the wall. if he closes the distance the output x or y value from the curve float can be multiplied to the speed of the player.