Was just doing a simple workout with C++. I have a very simple class that is basically a trigger box when something gets in turns on a light.
Everything works fine and compiles without errors. Just the the float variables I define in .h doesn’t seem to be re-adjustable in editor. I have also came across this:
If I remember things right, the constructor for actors in c++ just sets up the template version of the actor.
For something like the Blueprint Construction script in c++ you need override the OnConstruction(const FTransform& Transform) function.
Also when I tried it with packaged builds the OnConstruction function was not called, so you need to make sure to set up your actor on BeginPlay, unless this was fixed.
It looks like you’re only propagating your settings to the actual light component once, at the constructor, which is only run when the object is first created (and with the default values). If you move the two assignment lines ([FONT=Courier New]MeinLight->Intensity = … and [FONT=Courier New]MeinLight->AttenuationRadius = …) to the OnConstruction function (by overriding it as per Tomura’s suggestion), they’ll be run every time you modify the actor in the editor.
You’ll also want to override BeginPlay (added by default if you create a class from the editor) to execute these lines when the game starts, though I’m not sure it’s required if they’re directly modifying UPROPERTY values from the editor which should be saved with the level (but I’m not 100% sure).