Keep Character Movement is one direction, free of the camera

I use UE5 5.4.4
Hey! I want my first person character to, when sliding, only move where the camera was originally facing, causing the camera to become free to look around, while not changing the direction of the sliding; basically the sliding in Ultrakill for reference. Thanks for the help!

This will work if you have a character blueprint for the player where you already can’t place the camera on a higher hierarchy than the capsule component and the orient rotation to movement setting of the character movement component is turned off (you can still manually turn it off when sliding starts by using the blueprint node that controls that setting though if you want to have it in other times)

(The purpose of the sequence node was just to have the image fit in the screen)

And here’s the result:

This was just a demonstration showcasing the result on a third person character but it will work on a first person character as well. Just remember that you actually need a character blueprint even if your game’s gonna be in first person, just a camera isn’t enough.


Some Other Aspects You Can Adjust:

You can change the running animation with a sliding one by adding a bool type variable, setting it to true when the slide starts (doesn’t matter if sliding’s gonna be bound to an input action or an event) and setting it back to false when it’s over. You can use this variable in your animation blueprint by casting to your character blueprint to transition into a sliding state in the anim graph.

Also, you can set a max time for the slide by using the Get Time Seconds node, and set it to a float type variable after the event that triggers the Add Movement Input node. Then you can constantly check if that variable has surpassed the max time in the execution chain of Event Tick by using the Greater node, connect it to a Branch node and call a new custom event after it’s true pin. And that event’s white execution pin should be connected to that clear timer node. Or you can just plug another clear timer node after the branch’s true pin instead of an event but don’t forget to connect it’s blue handle pin accordingly.

Hope this helps! :innocent:

Hey, so funny thing happened. I copied your blueprints, except for changing enhancedinputaction stop to the completed action of the enhancedinputaction slide. Does that cause a problem because nothing changed at all.

Well it will just “slide” for the duration of the button press that way. Making it just a normal movement button.