Announcement

Collapse
No announcement yet.

Changing readonly values in Blueprint?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Changing readonly values in Blueprint?

    I am currently reading the documentation and I found this

    https://docs.unrealengine.com/latest...nts/index.html

    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

    Code:
    /** 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?

    #2
    Hi! When I wrote that page, I had similar questions, so hopefully I can clear that up a little for you. 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.

    Comment


      #3
      Originally posted by Lauren Ridge View Post
      Hi! When I wrote that page, I had similar questions, so hopefully I can clear that up a little for you. 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.

      Comment

      Working...
      X