In my game, there is a button “View the selected object.”
On it is pressed:
1) I spawn a CameraActor at the location of my character’s camera. I attach a CameraComponent of this spawned Camera to my character’s springarm & by SetViewTargetWithBlend
I activate this Camera as main.
2.1) Spawned CameraComponent rotates to the chosen target object
2.2) (if needed) my springarm rotates too to avoid the situation, when my char. obscures the view from camera to a target object.
3) after this the spawned camera detaches from my springarm and begins its flight to the target
4) When the flight is finished, I spawn a springarm component in the target object and attach CameraComponent to this springarm.
5) On every tick the new springarm rotates to be positioned along the vector from my char’s Camera to the target object.
When the button is unpressed, all begins to execute at reverse direction.
My problem: At some border points between adjacent phases of Camera complex moving visible jerking of the view occurs. They are visible only if my char and the target object are moving. If both are staying, all works perfectly smoothly.
I ask: If someone have had deal with complex camera moving and have encounter with similar problems, please give me an advice, how can I avoid those camera jerks.
I’ve tried many variations: setting up manually the location and rotation of camera, or of springarm before attaching, … explicitly detaching CameraComponent from springarm and not doing it, … the result was almost all the same.
PS: I didn’t public my blueprint-code here because it is huge (more than 20 screens) and complicated additionally by particular overlapping of adjacent camera moving phases for adding a smoothing effect.
But I think, that problem is not in my particular code. It is rather some principal dangerous place in such complex camera moving implementations.
Please point me to it.