Applying Rotations from Animated Camera Bone to FPS Camera Component Without Affecting Player Input

Hello fellow Unreal developers,

I’m facing an issue with an FPS setup in Unreal Engine 5 and would greatly appreciate some guidance.

Goal: I have a first-person weapon animation (skeletal first person mesh) imported from 3DS Max that includes an animated camera bone/camera animations. I want to take the rotations from this animated camera bone and apply them additively to the FPS camera component in my first person character actor blueprint. The aim is to have the in-game FPS camera mimic the movements of the animated camera bone, while still allowing the player to look around without interference from the applied bone rotations.

Setup:

  • The FPS camera is a child of a component, let’s call it “HeadComponent”. (I initially thought having a child actor as a parent to act as an intermediary for the camera animations would work but it did not)
  • The camera bone’s rotation is fetched using the Get Socket Rotation node. Debugging confirmed that the bone is indeed animated.
  • The character blueprint uses the Use Pawn Control Rotation setting. This is required for look input.

Tried Solutions:

  1. Delta Rotator Approach: I’ve calculated the difference between the current and previous socket rotations and combined this delta with the current control rotation. However, applying this resulted in the camera spinning around.

  2. Child Actor Approach: I tried making a child actor and setting it as the parent of the FPS camera component, thinking I could apply the rotations to this parent. However, when I tried applying rotations (both relative and world), it didn’t yield the intended results.

  3. Combined rotators (Socket Rotation + Control Rotation)

I tried all rotation spaces, world rotation, relative rotation, local rotation, I also tried both adding and setting the rotations on all those different spaces.

The closest I got to the desired result was:

  • Storing the initial socket rotation and camera rotation on Event Begin Play.
  • On tick, getting the current socket rotation and calculating the delta from the initial socket rotation.
  • Applying this delta to the HeadComponent.

However, this still causes the camera to move in unintended ways.

Any insights or suggestions on how to achieve this without affecting the player’s ability to look around would be greatly appreciated. Thanks in advance!