Changing readonly values in Blueprint?

I am currently reading the documentation and I found this

I am pretty sure that I have a bug in the docs but if it’s not a bug I would like to know why

/** point light component */
    UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Switch Components")
    TSubobjectPtr<UPointLightComponent> PointLight1;

They declare the variable as ReadOnly but they change the value in blueprint. In the construction script they use the set brightness function and in the eventgraph they change the light color.

How can they do this if the value is ReadOnly?

Hi! When I wrote that page, I had similar questions, so hopefully I can clear that up a little for you. :slight_smile: The Edit / Visible keyword applies to the actual property (the PointLightComponent), not the subproperties like brightness or light color. If the component reference was EditAnywhere (or BlueprintReadWrite), you’d be able to change the reference to that native component itself, which is illegal. It’s visible to you, but you can’t change it. The subproperties obey their own Edit/Visible rules.

Ah okay, thank you very much.