So I have my camera parented to a socket on the head of the Third Person Character so it looks like a first person game but still has head bobbing with animations. How can I make it so that when I rotate my mouse, it rotates the head instead of the camera? I already have ‘Use Pawn Control Rotation’ on the camera turned off.
I think I’ve got the 'Transform (Modify) Bone kind of figured out, what I need is to get the mouse location for the head to look at. I’m sure what I’m looking for is in the Character Movement Component but I can’t open that.
It’s not exactly the mouse location you use in this type of situation. Either because the mouse is locked at center of screen or you would stop being able to rotate once the mouse reached screen edges.
What you want is Mouse Delta, ie. how much has the mouse moved between frames. Go to Project Settings>Input and add two Axis inputs. One will be for horizontal delta and the other for vertical. Then add as input for each of them Mouse X and Mouse Y, respectively.
In your PlayerController right click and type the names you gave to your Axis inputs. It’ll create Events that you can get the Axis scale from to control the head rotation, adding some amount of degrees to it each frame. These events will be constantly fired (each frame) so you don’t need to set their values to variables and use on Tick. When you’re not moving the mouse, they give you 0. When moving, they give you how many pixels were the mouse moved between frames, positive or negative depending on direction moved.
These three videos from Unreal teach a lot in this subject:
any way to do this in 4.18? doesn’t seem to work anymore… and ive tried different methods but all make the head do weird turns and force the camera into random positions as i move the mouse…
The above answer is way too complicated. It’s a really simple fix.
You need to Enable Pawn Control Rotation on the camera and then in the Class Defaults of your character, search for Yaw and enable Use Controller Rotation Yaw.
TorQueMoD, as to the point and useful as that video is, I think the result of that video is the opposite solution to what the OP was asking (and also what i’m looking for). The video shows “essentially” a way to get the Headbone to rotate the Camera. I’m looking for a way for the Camera to rotate the headbone. ie, stand still and look around with your head while your body stays forward facing.
Oh you mean like the Free Look mode in PUBG? In case you haven’t played the game, like Tank Controls where you can look in one direction but move in the other?