Changing a post process volume effect

I’ve got a Post process volume in my game with some settings that I want to change at run-time (such as DOF). How can I access and change these values at run time in the code?

Check out

Here’s how I did it:

//Get reference to actor's camera
CameraHandler = GetOwner()->FindComponentByClass<UCameraComponent>();

//Enable override to properties that you want to change
CameraHandler->PostProcessSettings.bOverride_DepthOfFieldFstop = true;
CameraHandler->PostProcessSettings.bOverride_DepthOfFieldFocalDistance = true;

//Set the new values
CameraHandler->PostProcessSettings.DepthOfFieldFstop = 1;
CameraHandler->PostProcessSettings.DepthOfFieldFocalDistance = 500;