Announcement

Collapse
No announcement yet.

Camera Stabilization

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Camera Stabilization

    So I hope I am posting in the right spot, if not I can move it to another. I would like some help or tips on how to get my camera in FPS to be smooth like a third person camera. No bobbing up or down when walking, running, etc. I know every fps tutorial you look up for ue4 has the camera attached to the head but it gives a weird effect. Is there anyway to make it smoother almost like how a chicken head moves? If your wondering what my set up is like, I am using the Advanced Locomotion system V2.

    #2
    There's a lot of ways to approach this, but most will involve some kind of filtering system. If you're doing this with just a straight camera and no boom, then you'll have to do some filtering of your own. This is probably going way out on a limb, but you could probably code in a simple PID controller to help smooth things out some. Though keep in mind that there are many other filtering systems like a PID, it's just a well known spring-mass-damper example. The controller would be setting the setpoint and within the BP, it would calculate where it should be for the frame vs the previous frame. It shouldn't be too complicated to implement. You end up with a curve like this where it slightly overshoots and kind of bounces around the set point until it reaches steady state. The tuning of the "circuit" determines how quickly that happens. You could make it happen in a few frames or over half a second, it's up to you. The only problem is that if you're playing some FPS like Counterstrike, you obviously don't want the crosshair doing any form of unwanted movement. For other FPS type games, filtering like this can make a big difference in immersion because it gives the camera a sense of weight.



    The alternative would be to use a short camera boom and play with the lag settings within it. I'd probably recommend this method most, unless you really know what you're doing with PIDs. Just make sure to check collision channel settings and such to prevent it having issues when interpenetrating the character model.

    EDIT: Oh and one more method you could use would be to make the camera bound to a socket that is a direct child of the root bone (assuming the root bone isn't moving and swaying around. Just set the socket to where you want the camera to be and then you wouldn't have to worry about the head animations causing the camera to spaz all over the place constantly.
    Last edited by IronicParadox; 04-02-2018, 06:22 AM.

    Comment


      #3
      Using the player controller rotation clears up a lot of the movement.

      You can see the result of doing so here:
      https://www.youtube.com/watch?v=CbSqIV6LaLo

      Using a spring arm with various settings to smooth it out as well.
      Rule#21: Be polite, be professional, but have a plan to kill everyone you meet.

      Comment

      Working...
      X