When a component property is set outside of the constructor (in OnRegister() for example), blueprint instances of the property become read-only if the blueprint default is empty.
This only occurs for blueprint property instances, adding an instance of the component directly to an actor in the viewport will still allow the property to be edited
Workaround:
Defining any default (in class constructor or inside blueprint) will allow the instanced property to be edited
UPROPERTY(EditAnywhere, Category = "Test")
FString CustomString;
void OnRegister() override;
void UMyActorComponent::OnRegister() { Super::OnRegister(); if (CustomString.IsEmpty()) { CustomString = "NonConstructorValue"; } }
Result:
The CustomString instance variable is populated with "NonConstructorValue" but is uneditable
Expected:
Variable remains editable based on UPROPERTY settings
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-50759 in the post.
1 |
Component | UE - Gameplay - Blueprint |
---|---|
Affects Versions | 4.17.2, 4.18 |
Created | Oct 4, 2017 |
---|---|
Resolved | Oct 4, 2017 |
Updated | Apr 27, 2018 |