UPROPERTY Default Value

The editor does not recognise the default value set in C++ on UPROPERTY members of either a USTRUCT or UCLASS. I have tried setting a default value in both the constructor as well as in the header declaration. No matter what I try the little yellow arrow still appears next to every member in the editor. Clicking the yellow arrow does nothing either.

screenshots?

Hey -

When I change a variable value in my struct/header/constructor I see the change reflected in the editor after compiling.Can you provide additional details about the behavior you’re seeing and the setup you’re using?

I have created a sample project to demonstrate the problem. I think it has something to do with arrays. Just open this project up and compile it. Then open the NewBlueprint I created in the Content folder. Take a look at the array I put in there. This comes from the C++ class with a C++ struct. Notice the little yellow arrow next to every variable in the struct. If you check the C++ source you will see that the default values have been set for them.

Based on the tooltip it seems like the little yellow arrow is there because the array is not at its default size. But that should only put a yellow array on the array itself, not on every member of every entry in the array right? Please tell me this is not “by design” but is instead a bug.

Hey -

Thank you for the sample project. You’re correct that it appears to be a combination of the struct being inside of an array. I have reproduced this issue and logged a report for it here Unreal Engine Issues and Bug Tracker (UE-38569) . You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.

Cheers

Still not fixed in 4.21.2 version. Also if you have a

UPROPERTY()
class UChildActorComponent* ChildActorComponent;

in that struct inside TArray and you click the yellow reset arrow, the property is set to ‘None’ instead of nullptr, and the actor is not garbage collected.