Description

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

Steps to Reproduce
  1. Open UE4 Editor (any project)
  2. Add code to project based on Actor Component (MyActorComp)
  3. Add the following to MyActorComp.h
    UPROPERTY(EditAnywhere, Category = "Test")
    	FString CustomString;
    
    void OnRegister() override;
    
  4. Add the following to MyActorComp.cpp
    void UMyActorComponent::OnRegister()
    {
    	Super::OnRegister();
    
    	if (CustomString.IsEmpty())
    	{
    		CustomString = "NonConstructorValue";
    	}
    }
    
  5. Compile
  6. Create a blueprint based on Actor (BPActor)
  7. Add MyActorComp to BPActor
  8. Add instance of BPActor to the viewport
  9. Select the MyActorComp in the instance Detail panel

Result:
The CustomString instance variable is populated with "NonConstructorValue" but is uneditable

Expected:
Variable remains editable based on UPROPERTY settings

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-50759 in the post.

1
Login to Vote

By Design
ComponentUE - Gameplay - Blueprint
Affects Versions4.17.24.18
CreatedOct 4, 2017
ResolvedOct 4, 2017
UpdatedApr 27, 2018
View Jira Issue