How do I move a camera from one location and rotation to another over a time interval?

Hello,

I am new to UE4 and Blueprint Scripting. I need help moving a camera as an actor from its original location and rotation to a second location and rotation over a designated time interval. I want the viewpoint when the level plays to be the viewpoint from the camera, so I can see visually what the camera is seeing. I need the camera to start moving when the level plays, if at all possible. This is the script I currently have, but it, unfortunately, does not work.

For the two Lerps, I inputted random coordinates to see if the camera would move. If there is another way to do this, please feel free to share! I am pretty lost. Thank you for the help!

You’re on the right track. Golden rule with timelines is you have to calculate the ‘from’ and the ‘to’ before you start the timeline.

You’re sampling location and rotation in the loop. That’s the problem.

Currently, you don’t need this bit ( it does nothing )

But change it so it stores the location and rotation in variables before you start the timeline, and then use those variables during the timeline, and you should be ok.

PS: An easier way to fill in the coordinates, is to just drop an empty actor in the level, then refer to this in the level BP and you can get it’s location etc there…

You can also put the Camera on a Sequencer shot, set the transforms you want the camera to have at each point on the timeline, and play the Sequence when you want the camera to move. This approach is easiest for cutscenes where you know where all the actors involved will be, but I believe it can be used to set things more dynamically like a relative rotation and location for example (I just never tried it myself for that yet)

Also, doesn’t the cameramanager that PlayerControllers have, have a SetViewTargetWithBlend node that you can set how long it takes to move from one actor to the other? Depending on your situation that might be the fastest easiest way.