Download

True first person aim down sights

I’ve been working on a true first person viewpoint and I’ve gotten everything working great so far except for aim down sights. I’m using a fairly standard setup with the camera attached to a socket on the head bone, and using aim offset, layered blend per bone, and look at controller to get the gun to aim in hip firing mode. The problem is, with hip firing mode I don’t need to be very precise in my positioning of the gun so it looks nearly perfect for that. What I’m trying to do now though, is get the aim down sights system working and it’s not staying precisely in the middle of the screen. As you can see from this video, the gun sight positions drift when looking up and down.
[video]https://youtu.be/FCUFxd3VBHY[/video]
I’m using IK in bone space with the head bone as the frame of reference, and I’m also setting the head bone rotation to directly match the camera rotation to get rid of any differences in the aim offset animation and the camera’s actual rotation. Does anyone know a way to fix this? It’s the last little issue with my aim down sights system that I can’t figure out. Btw, I don’t really care how bad the solution ends up looking in third person as long as it looks good from first person, because I’m only applying this IK setup from first person anyways.

I know, it is an old thead, but i have the exact same Problem, so i am responding here.

I tried to find a solution for the whole day with no efford. At least i found the cause of this failure.

As the thread opener, i am working on a “true first Person shooter” and iam using Epics default Mannequin (without its head, but same Skeleton and animations).
I attached the FPS Camera to the “head” bone of the Skeleton. After that iam using a “two bone IK” with “Hand_r” as IK in “bone space” and “head” as the end effector. After that i use a “transform modify bone” to Position the Hand_r correctly.
The weapon itself is attached to a socket, that is bound to the “Hand_r” bone. (Left Hand is irrelevant right now)

So now, both are connected well. And the Hand is following every head movement. But with a Little off track as the thread opener mentioned and showed in his Video, while aiming far up or far down.

The causer is an Option for the FPS Camera itself! If i disable the “use pawn control Rotation” Checkbox, the weapon follows the exact same spot infront of the head no matter where iam aiming at.
Iam asumeing: As Long as iam requireing this Checkbox inside the camera, my only Chance would be to get this same function to run on my weapon too (so that it compensate some of the Animation Head rotations). But iam not able to do it.

Do you guys have any advice for me?
Maybe you are doing it on another way? I would be glad to hear of it.

So actually I remember how I fixed it. Basically it turned out that I needed to set the camera rotation in the update method instead of directly in the input event. So in the input event I changed it so that it added/subtracted to pitch and yaw variables and then set the camera component’s actual rotation at update time. Otherwise the mouse events happened faster than the animation updated and the hand wouldl ag behind.

Thanks for your quick answer, but as iam not that used to the engine right now, i have a following question:

You used the terms “update method” and “input event”. So i suppose that the “input event” is part of the player controller, or the character itself, depending where i put the controlls in, right?
And the “update method” is the part in the “animation blueprint” of the skeletal mesh. The “Event Blueprint Update Animation” inside the “Event graph” i suppose?

Input event is part of the character. I think it was usually called AddControllerYawInput or AddControllerPitchInput or something like that. You can usually find what methods things are bound to in SetupPlayerInputComponent in case I’m wrong though. Update is actually called Tick now that I remember.