So, here is the code:
void AMskPlayer::StartHeadBob(TSubclassOf<UCameraShakeBase> CamShake)
{
auto *Cam = GetCameraManager();
if (!CamShake || !Cam)
return;
StopHeadBob();
CurrentHeadBob = Cam->StartCameraShake(MatineeCamShake, 1.f, ECameraShakePlaySpace::CameraLocal);
bHeadBobActive = true;
}
void AMskPlayer::StopHeadBob()
{
if (!bHeadBobActive)
return;
bHeadBobActive = false;
GetCameraManager()->StopCameraShake(CurrentHeadBob, false); // <- Doesn't stop the shake
// GetCameraManager()->StopCameraShake(CurrentHeadBob, true); // <- Stops the shakes non smoothly
}
As long as the flag bImmediately is true, it does work, but it’s not smooth.
This is the nature of my shakes.
I have tried may things but nothing seems to work. Help!