If an actor component contains a TArray of instanced objects, some of those object instances can get incorrectly invalidated and marked for garbage collection in certain situations, possibly resulting in data loss for the user.
In particular, this behavior can be consistently reproduced in UE 5.3.2 and UE 5.4.1 when undoing an actor translation after some specific steps (see repro instructions).
1) Create a new blank C++ project
2) Add the following C++ classes:
UCLASS(EditInlineNew)
class UDataTest : public UObject
{
GENERATED_BODY()
UPROPERTY(EditAnywhere)
int32 MyData;
};
UCLASS(meta = (BlueprintSpawnableComponent))
class UComponentTest : public UActorComponent
{
GENERATED_BODY()
UPROPERTY(EditAnywhere, Instanced)
TArray<UDataTest*> Array;
};
3) Compile and open the project in the Editor
4) Create a blueprint actor
4.1) Add "UComponentTest" component
4.2) Populate "Array" with 3 "UDataTest" objects
4.3) Set the "MyData" property of these objects to 0,1,2
5) Create an instance of the actor in the world
5.1) Remove array entry at Index 1 (do NOT just clear the object instance, instead delete the array entry as a whole, the array will then have only 2 entries remaining)
5.2) On the array entry at index 0, modify the "MyData" property from 0 to -1
5.3) Reset array entry at index 0 to the default value (do NOT reset "MyData" or the object instance, instead reset the array entry as a whole using the rightmost reset arrow button)
6) Translate the actor on the viewport
7) Press ctrl-z to undo the translation
--> Note that the array entry at index 0 now contains an invalid object instance. If we use "gc.CollectGarbageEveryFrame 1", that object instance is immediately set to "None".
i have this problem UE4CC-Windows-58DC12AF4B97F057BD108FBFF569B2E9_0000
I am not able to find world outliner how to enable it?
Delay nodes occasionally don't fire the "Completed" output in a nativized build
Undefined sysmbol: typeinfo for AActor when cross-compile linux dedicated server on windows
How can i modify the param name in EQS node
When I open UE4 4.24.3 it appears that. Does anyone know how to solve?
What method is used to fill polygonal regions when drawing spline mesh at run time?
Teleporter in the Creative Hub is Locked and cannot be accessed
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-216453 in the post.
2 |
Component | UE - Gameplay |
---|---|
Affects Versions | 5.3.2, 5.4.1 |
Target Fix | 5.6 |
Created | Jun 4, 2024 |
---|---|
Updated | Oct 1, 2024 |