I wanted to create an orbit cam and shoulder cam. Here is the code
FVector Loc, Pos, HitLocation, HitNormal, EyeLoc, FinalPos;
FRotator Rot, EyeRot;
FPOV OrigPOV;
FMath math = FMath();
AShooterCharacter* TypedTarget = Cast(OutVT.Target);
//It should be header file, but for now it will work.
FVector LowOffset = FVector(-100.0f,0,20.0f);
FVector MidOffset = FVector(-200.0f,0.0f,20.0f);
FVector HighOffset = FVector(-100.0f,20.0f,20.0f);
FVector FinalOffset = MidOffset;
OrigPOV = OutVT.POV;
OutVT.Target->GetActorEyesViewPoint(EyeLoc, EyeRot);
Loc = OutVT.Target->GetActorLocation();
FVector const Offset = FVector(-150.0f, 0.0f, 0.0f);
FinalPos = EyeLoc;
FinalPos += FRotationMatrix(EyeRot).TransformVector(FinalOffset);
OutVT.POV.Location = FinalPos;
OutVT.POV.Rotation = EyeRot;
const bool TargetingView = TypedTarget->IsTargeting();
if (TargetingView)
{
MidOffset = FVector(-100.0f,20.0f,20.0f);
}
basically right click causes targetingview to go true which is working but what i did is that it will go to a shouldercam offset which is not happening, it stays orbit if when targeting. Any help please.