Temporary Camera Lag

When I sprint, I’d like the camera to lag just a little bit behind the player and then slide its way back into place and then stay put. How would I accomplish this?

I think in the camera settings there’s a function called “Camera Lag”. If not there look in the Spring Arm settings.

I know how to initiate it, but a way to get it to smootgly move back into place would be good as well

Hi @BioCoder,

I accomplished this on my Thirdperson Template by modifying the Camera Boom arm length while the Player was sprinting. Im not in my dev machine so I cant pull the BP nodes, but I think I ended up using FInterp to from the “Standard Arm length” to the “Sprint Arm Length.”

You can see the results here:

Feel free to download the template and copy the code yourself to suit your needs.

Hope this helps!

Im following your example but I cant seem to figure out the Finterp too node for the life of me. It seems no matter what I plug in the transition is instant

Hi @BioCoder,

Make sure you put the FInterTo node on a timer or Tick so it smoothly transitions from one value to another. Also make sure the Interspeed is more than 0 (instant) and use World Delta Time.

Let me know if this helps!

Thanks for the advice

I think I’ve been going about this the wrong way
I had it so that the shift input would set the camera distance with an finterp attached to that. But instead I should attach it to the tick? Maybe with a bool?
What’s the normal procedure for this?
Sorry for my inexperience

Yeah, the FInterpTo node needs to be called many times to interpolate properly. I would create a Custom Event (Call it EventCameraLag). When you press Shift, call EventCameraLag.

EventCameraLag starts a timer (Add timer by event) which loops at a frequency of 0.01secs. This timer then runs the code with the FInterTo node. When you Release Shift, then call another Event that does the opposite. You should pause the timers when not in use for efficiency (search for Pause Timer by Handle to figure out how). Alternatively, you could use a boolean on Tick to do the same thing (though not recommended as Tick will run at a different speed on each machine).