Funnily enough I have found a relatively good solution already for slightly different context.
SoSeductive69_Tv FindLookAtRotation
Rough Solution:
- I acquired the
NewCamera->GetActorUpVector()
when the camera was created which uses the UeRotation as it was spawned previously mentioned and stored it on the camera class. - Then I used the UpVector stored which is reflective of the UeRotation on spawn which points upwards from the world surface as the upDirection in the MyLookRotation function.
- The lookAt as the Tracking Actor location vector.
- And it returns the needed FRotator you need for the FQuat::Slerp Quat2 param.
Visually it looks like this:
FRotator LookTo = MyLookRotation(ActorToTrack->GetActorLocation(), InitUpVector);
FRotator LookAtRotaion = FQuat::Slerp(GetActorRotation().Quaternion(), LookTo.Quaternion(), FMath::Min(1.0f, DeltaTime)).Rotator();
SetActorRotation(LookAtRotaion);
What I have yet to fully understand is the Math and if some of the existing functions in UnrealEngine could be used instead.
Would like to know If anyone else found a more refined solution?