Camera is being real jerky in game

Due to how my game is set up I have to use a separate camera object that follows the player around as the player is frequently changing possession of different pawns. With this camera object I use vinterp and rinterp into set world location and set actor location respectively to lock the camera to the pawn while allowing some “bounce” so it doesn’t look super static and terrible. These are run through tick. I’m realizing that tick may be the source of my problems but I just don’t know a way around it.

I’ve tried simplifying it down so that it’s just using the raw transform of the targeted actor but its still not looking very smooth. I know tick can be bad but there is no way it is THAT bad…

Try using Timelines.

Firstly, we found a performance boost by switching from Tick to Timelines for any perpetual processes when using Blueprints.

Secondly, you can control when they start/stop, play them in reverse, start at specific times, etc. You have full control of any perpetual/singular processes being handled by each Timeline.

And Thirdly, Timelines can output data and events via a 2D graph. This is fantastic for moving objects. You have a visual representation of how you want your data to fluctuate, which can power the alpha of lerps or whatever else you need. You can very easily avoid static, linear motion, and add some colorful details, by setting up points on the graph and creating curves. Right-clicking each point lets you setup up various methods of interpolation, which you can then control with visual handles for smooth curves.

For your situation, you’ll have less math to deal with and more of a visual, creative control over the camera movement. Easier, with better results.

And yes, I’m quite biased; I’m a total Timeline junky. But that’s because it made working in Blueprints approximately 10x easier and faster.

I understand replacing the tick with a timeline, but I’m not sure how I can use the timeline to effect how the camera moves. Maybe with a static camera, or one that follows a set path but im not sure for how Im supposed to do it with a third person camera

How are you moving it now? Setting world transform based on new player possession? In Level Blueprint? In a Blueprint for the camera itself?

Yeah, from the camera blueprint I’m taking the world transform of the currently possessed pawn and rinterp/vinterping the camera to that location

This is kind of an uninformed guess based on the info you gave me, but basically:

  • Capture current transform
  • Timeline fuels lerp for Set Actor Transform
  • A is current transform
  • B is current player pawn transform plus an offset (idk what you’re doing there, so…)
  • Alpha is fueled by Timeline graph

Graph of Timeline shows how you can use the points to make a nice curve. This actually shows a little “shake” too, going slightly above and below 1 before settling into the final 1 value.

This is an extremely basic example, but you can easily create multiple graphs within the Timeline, break up your Transforms, and use various modifiers output from the Timeline into the individual Transform components to gain control over the details of exactly how everything is moving.