I’ve tried to move my code from blueprint into C++ for camera shake, but apparently it’s not working
Here’s the code
UCameraShake* CameraShake = ConstructObject<UCameraShake>(UCameraShake::StaticClass()); CameraShake->OscillationDuration = -1.0f; //negative value will run forever CameraShake->RotOscillation.Pitch.Amplitude = 1.0f; CameraShake->RotOscillation.Pitch.Frequency = 0.5f; CameraShake->RotOscillation.Pitch.InitialOffset = EInitialOscillatorOffset::EOO_OffsetRandom; CameraShake->RotOscillation.Yaw.Amplitude = 1.0f; CameraShake->RotOscillation.Yaw.Frequency = 0.5f; CameraShake->RotOscillation.Yaw.InitialOffset = EInitialOscillatorOffset::EOO_OffsetRandom; Controller = GetWorld()->GetFirstLocalPlayerFromController()->PlayerController; Controller->ClientPlayCameraShake(CameraShake->GetClass(), 1.0f);
Here’s the blueprint call and the testCameraShake class that is used on blueprint
I’ve seen answers on Camera Bob/Shake - Programming & Scripting - Unreal Engine Forums but the solution don’t reflect to my issues, checked on the values with debugger and see it populated correctly (I think)
Anything I missed? Thanks!