Thoughts on how to remove head bob from a True First Person character?

Hey everyone. I was just wondering if anyone had any ideas on how you could remove the “head bob” associated with a True First Person character where you use a third person setup and then parent the camera to the head bone?

My first thought is to just remove any Z motion on the pelvis in the animations but this comes at a cost of not looking as good in terms of animation. Granted you probably wouldn’t notice in first person but I just figured I’d post here to see if anyone else has successfully tackled the subject or has any ideas on how it could be done?

Dont attach the Camera to the Head or any bone

I think I recall Star Citizen doing a video about head bob and using a true first prison camera.

Maybe do some funky full body IK that softens the bobbing for a locally controlled player.

  • Eye stabilization

  • Horizon alignment

  • Head stabilization for extreme motions

If you do that though, your character’s body can clip through the camera in some animations so it doesn’t work. I Tried it already.

@ZacD Thanks for the video! Yeah, I think it’s going to be a little difficult for me to code an eye and head stabilization system so I think I’ll just go with stripping out the Z movement from the animations I’m using since my results aren’t this extreme. Mostly I’m just experiencing extra bouncing.

I did come up with another idea that I’ve tested and it works quite well which was to actually just use a typical First Person setup and then add in the third person body and sync the movements to the player’s by using Aim Offsets. This eliminates the camera bob entirely and also gives you a pretty realistic shadow response too but it means you need completely separate animations for the hands and body which makes for a lot of extra work.

A simple way is to use spring arm, make it child of the character mesh, then set springarm Parent socket to Head, don t forget to check use pawn control, then place camera child of camera boom.
Camera is now true fps with no shake at all, if it shake you have made a mistake, add some camera lag for even less shake ( it shake a bit tbh )
2019-05-27 20-55-50 ( without camera lag )

Yeah, does a spring arm work still for True First Person? I figured it would mess with the rotation but I’ll try that later tonight and let you know if it works. Thanks!

Are you using the rotation from the head bone or the controller?

Fix your animations. Not the answer you probably want to hear, but it’s what you should be doing. In these systems it is common for the camera to have a dedicated bone, and for animations to be authored with this in mind.

If you look in the first person template, you see that there is no head, so there’s nothing that can clip into the camera. You probably want to have two different meshes, one for the first person view, and another for third person view, and just hide the one that isn’t relevant.

A True First Person perspective is where you actually have a full body present on screen. I know how a typical first person setup works but thanks :slight_smile:

As is pointed out in that Star Citizen video that ZacD linked to, there’s a lot of head movement in mocapped animations so it’s hard to avoid clipping while also keeping the camera in the right location for the body to look correct. I think that’s why you often see it where the head is removed and added in for shadows only which is probably the easier way to do this.

This worked perfectly for me. This worked better than I had ever imagined. Thanks for this!

Would you mind giving some more details on what you did because I tried this and it didn’t work. What was the length of your camera boom for example?

Sure. First a little background on what I have:

I started out with the Third Person Template several months ago. I modified the Character Movement class and enabled “Use Controller Desired Rotation” so that I had a traditional TPP look and feel. I also have tons of animations that I’ve added and modified targeted to the normal Unreal Skeleton. All this time I’ve known that I will eventually add a FPP view, but put it on the back burner because I figured it would be easy (as you know, it’s not) - My first attempt was attaching a new camera to a Head Socket on my player. During play testing I got motion sickness and needed to take a rest. I also had tons of clipping because my animations caused shoulders and arms to clip the near plane of the camera. I started to resign myself to the fact that I would have to go old school and just go with a pair of FPS arms and do the whole hide/show mesh thing. Then I found this thread and Samuel’s post.

  • I added a Spring Arm to my character mesh and attached it to a Head Socket
  • I added a new camera and attached it to the Spring Arm Socket
  • Under camera settings, I enabled: “Use Pawn Control Rotation”, “Inherit Pitch”, “Inherit Yaw” and “Inherit Roll”
  • In the Camera Details under Camera Operations, I enabled “Use Pawn Control Rotation”

Once these settings are in, you won’t be able to rotate/move the camera in the view port. All the finesse needs to come from the Spring Arm. I played with the Spring Arm until I was not seeing any clipping and I had the view I wanted. My Spring Arm length is only 5.5f, but it’s arbitrary since you’ll need to find out what works for your character and the view you want to present.

It took me a few hours to come up with the settings that worked, but the result is night and day. I now have a First and Third person camera setup that use the same animations. My FPP view can look down at feet and legs and if just feels real.

Quick note: I noticed some weirdness in the editor when setting this up. Sometimes my camera would show backwards in relation the the player. After I restarted the editor, all was fine again. It didn’t cause any issues, but it did confuse me for a bit.

I hope this helps but let me now if you still have questions.

The best way I found to stabilize the bobbing is to manipulate the camera location based on previews frame and distance.

To avoid puking you want to disable all small movement occurring within a frame.
Let’s say a distance of 10 or greater is acceptable as it will signify the camera is moving along with the character.

The end result of setting up something similar is a responsive camera that moves with the character but doesn’t (assuming your animations aren’t really bad and move the head more then 10cm per frame) Bob or twitch along with the animation despite being hooked to the head bone.

For further development I create a Camera bone so that i can actually attach the camera and manipulate the bone directly. This proved to work much better in the end as the bone movent is a little more straightforward than socket placement or camera component local values.

The obvious benefit is that you can also create scripted views by manipulating the bone for things like cinematics without having to say tilt the character’s head in a way that’s not anatomically possible just to look up or down… and still allow for transitions between 3rd and 1st.

As a note on that, child actors are the way to go so that you may actually use the built in camera transition system.

This is a really interesting idea. I’m assuming you save the camera location in world space each frame, then compare the current position with the previous position to come up with a Delta? If the delta (on the axis that you care about) is less than your threshold (10cm in this example) you then what? Move the camera to the previous location?

Well, not exactly, you move the camera to where it’s supposed to be but you overwrite the Z location.
usually the Z motion is what causes sickness - that’s with decent animations.

You want X and Y to be fully responsive or the camera will literally stagger even with interps to lessen the effect.

However rotation is never ignored and usually not driven by animation / there is an AO setup that fixes head position.

If your head goes in a no or yes motion too fast you’ll still get sick no matter what. so I avoid these motions and usually set the character’s view (the little eyes in riggify rig) far away so as to get the most steady pose possible.

Yeah, I found this to work really well in my testing as well. I’m still interested in trying the camera boom again as the boom really helps to smooth out motion.