FPS camera jerks if IK is implemented

Hi there. I have a character (default queen skeleton) with IK implemented. Also there is a the camera attached to head bone. The camera lags 1 frame after the actual mesh position, what comes to ugly jerking if character capsule moves fast up and down. Here the video with the problem:

Green box in character head represents actual camera transform. You can see that the camera mesh is in right place, but it is not an actual render position!

My calculations are happening into my own anim node.
I’m trying to figure this out already a week. I’m in despair, because i don’t know what to do.
I tried to apply different IK nodes - Control rig node, two bone IK (actual) - there is no effect. I tried make calculations inside of control rig, outside of control rig, inside separate anim node - there is always this bug.

I don’t know what to do, i have no idea. Maybe it is a bug of actual 5.1 Unreal version?

I don’t want to calculate IK inside the game thread, because it uses unactual pose from previous frame and after calculating new pose these parameters already unactual, and makes a really weird mesh behavior when character steps through the object.

Looks all kinds of wrong.
Starting with your base animation cycles.

Test it by running a permanent (small) sphere trace on the head bone - where the camera is usually attached.

You have a good solution when the output looks smooth in all directions. Any sudden dip or swing is usually a result of a bad starting animation.
With and without IK.

The Ik itself needs to solve the position needed in the next frame.
So where you trace and how should depend on speed and frame rate.

Doesn’t much matter where in the character bleprint you make it happen – but it definily is not to be done anywhere outside the character blueprint, With a possible exception of control rig.
However IK is such a basic kind of thing, that using control rig for it makes little to no sense.

Again, permanent traces are a great way to figure out if anything is bad - like IK being applied immidiately instead of gradually during a cycle for instance.

1 Like

Hello, thx for your reply. Just to clearify, because i dont understand - how is it possible to calculate IK for the next frame, if you need a reference pose, from what you will calculate an actual offsets?

It depends, for feet, an approximate location based on the speed and velocity - a box trace roughly the size of the foot - usually works.

However the position is not necessarily going to be active with a full alpha value - the IK curves are in charge of determining that position on top of the future location. If the curve is wrong or you just have 0 and 1s you are also going to have snap issues.
They propagate to the head since a proper IK system will shift the pelvis down.

1 Like

Can you show any example where this algorithm is implemented, on YT or maybe on the marketplace? Sounds cool but I never sought that someone using this.

Also, I was making a lot of testing yesterday, and looks like this is not a problem in IK at all in my case, and there is some kind of error inside my character BP construction or his C++ parent, because i tried to simplify all what even possible and this glitch recreates even with very basic ABP with very basic IK from third person example, and standart player BP from this example have not this bug at all.

Maybe it’s caused by multiple engine version conversions, because originally this project has been started from 4.26 and now it is on 5.1. I hope I somewhere close to the solution :slight_smile:

Well, i just finished solving the problem, and the problem is a some kind of a weird bug inside of UE. All I’ve done is recreated my character BP from scratch and now all work pretty fine and smooth. I think the problem is in multiple recompilations of CPP headers in combination with multiple engine version switches, but it’s just a my guess.