How do i rotate FP controller according to current gravity?

How i can set the Control Rotation of the first person character accordingly to the gravity without locking the movement of the camera?
I’ve managed to rotate the actor, but i can’t use the same method for the controller, since it will lock the movement of the camera

You kind of can’t.
No really.

The movement component assumes you move on x/y axis unless its been updated recently.

You need your own movement componet that does the line traces you need with an angle derived from gravity.

This isn’t anything new by any means, there’s probably 1001 marketplace packs for it you can choose from.

The difference is that the right module will properly rotate your collision capsule and work correctly.

Anything else (or even packs that work on the existent movement componet) as hacks which generally tend to break something - like replication for instance…

Is it complicated to make a custom movement component that calculates input directions based on gravity direction?
I know C++ but I have never tried it applied to Unreal Engine, and I don’t know if it’s worth to try making my own movement component or just quit the project since every marketplace pack I found isn’t free and I’m not willing to pay for a pack.

Its only complicated somewhat if you need to addin replication.

Though obviously, even with c++ knowledge getting used to how the engine wants you to write code is its own challange.

1 Like