New camera system | Prevent camera from jumping with character

Like i said i would use a timeline.


100724-180706

In my case i set thet timeline length to 1 instead of the default 5. You will have to tune the interpolation speed and timeline length to get a perfect result, but this approach is far more efficient than relying on event tick for the interpolation.

I encountered the issue in your OP there, so what’s apparently happening is that when the player lands the capsule component for some reason doesn’t exactly match it’s original Z location. I think it’s possible the height of the capsule is being tweaked the second you land because of the crouching animation that happens upon landing (the height is also tweaked like that when you actually crouch) which would have this effect. It could also just be an inaccuracy in the engine.

I solved it by simply adding a tolerance range for how close to the original Z you need to be for the interpolation to take effect.

The tolerance range I used is 0.1 but you could possibly want to set it higher because at this state if the ground is even just a little bit uneven the camera will jump to the new height, a value as high as 10 might be good.

Edit: Also on finterp, it takes two values (current location and target location) and spits out a value somewhere between the current and target location (the higher the interpolation speed the closer to the target location the number will be), for it to work it needs to be executed every frame which can be done via timeline or event tick or maybe even a loop in some cases.

If you removed the ‘do once’ node your interpolation code would work however it would be inefficient because that code would be running every frame even when you don’t need it, which will quickly slow down your game’s performance (especially if you keep adding more things to event tick), hence why I suggest using do-once and timeline instead.

An alternative would be to toggle ticking on and off based on when you need thte camera to be moving but that requires a lot of finesse and potentially a lot of changes to your overall blueprint.

1 Like