Prevent camera lag when teleporting pawn ?

If you use spring arm to control player camera, you can turn off lag in spring arm

Hello,

I turned camera lag ON for when my pawn move around, it’s nice and smooth, but I’d like to NOT have it when it teleports (either using Teleport node, or SetActorLocation). Is it possible ?

Since the player can move around still while teleporting, I can’t temporarily turn it off during the teleport.

Thanks

That’s the thing, I don’t want to turn it off entirely. I just want to teleport the player and keep the current relative position of the camera without it being affected by the teleport.

Do you mean that you want to keep the camera in origin offset after teleport?
If so, you can try calculate the delta position of pawn during teleport, and set it back to Spring Arm’s location, spring arm locks itself toward its location.

I think I tried that already, but if I change the spring arm or camera location, it messes up it’s relative position with the player. At any point the relative location of the spring arm and camera is returning me 0,0,0 even though it’s lagging behind.
It kind of suggest that the physical presence of the component never change location relatively to the pawn, but the lag shifting is something else, not accessible.

Spring arm’s location won’t change during lag, You can try to inherit USpringArmComponent, and then override BlendLocations() and UpdateDesiredArmLocation(). Most of the spring arm lag logic are in UpdateDesiredArmLocation(). Take more control over lag speed may help too.

That requires code I suppose. Can’t do :confused:

Maybe you can try this trick: spawn a dummy actor with spring arm and camera, and make it follow your pawn every tick with relative position as you want.

Yes that’s exactly what I ended up doing ! Recreating the camera lag system using an external camera actor that has a Set World Location with a Vinterp on every tick.
That gave me all the control for a regular teleport.
Thanks for your time

Yes that’s exactly what I ended up doing ! Recreating the camera lag system using an external camera actor that has a Set World Location with a Vinterp on every tick.
That gave me all the control for a regular teleport.
Thanks for your time