For such a simple problem, I have wasted so much time and am no closer to finding an answer.
I have a blueprint (pictured below):
I am trying to convert this to C++… but I have a problem getting a reference to the sky light in the scene. As you can see in the blueprint, the type is “Sky Light” which then I get the light component of, and set its intensity. In C++, it seems there is only a variable type for the skylight component, not the skylight scene object…?
In any case, I created a sky light component var in C++ and tried to set it from within the editor
Property def in C++ class
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = References)
USkyLightComponent* SkyLightRef;
So e.g. goal would be the following code working to turn off the sky light:
SkyLightRef->SetIntensity(0.0f);
…except I have no way to set the variable within the editor the the sky light that’s in the scene. It’s value is “none” and I can’t change it to anything else.