I think it’s definitely being garbage collected, to prevent that you have to add UPROPERTY()
just above your variable. Like so:
private:
UPROPERTY()
float CameraRotationYaw;
There are also very handy things called specifiers in Unreal that you can put inside the parenthesis that will help you in the future more info here on specifiers