This is an issue with how FPropertyValueImpl::ResetToDefault works: it uses GetDefaultValueAsString to reset the default value. This is problematic because the LexToString function that is eventually called uses a format specifier of "%f", which defaults to a precision of six.
In the above example, 0.15 + 0.3 is actually 0.449999988079071044922, but LexToString converts to 0.450000, which is what we set the component's value to. As a result, diffs with the CDO's value will always fail.
To reproduce this issue, create an actor component in C++ and add a property like this:
* Create an Actor BlueprintUPROPERTY(EditAnywhere)
double MyTestDouble = 0.15 + 0.3;
The second step is even more scary, because it will cause bad property values for actors in the level:
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-149061 in the post.
4 |
Component | UE - Gameplay - LWC |
---|---|
Affects Versions | 5.0 |
Created | Apr 13, 2022 |
---|---|
Updated | Jan 22, 2024 |