When adding elements to an array inside a code class, blueprint instances of the class do not have their array updated after a hot reload.
1. Open UE4 Editor (any project)
2. Create new class based on Actor (MyActor)
3. Create new class based on Object (MyObject)
4. Add a statement to include MyObject.h in MyActor
5. Add the following code to MyActor.h:
UPROPERTY(Instanced, EditAnywhere, EditFixedSize, BlueprintReadWrite, Category = "Test") TArray< class UMyObject* > MyArray; UMyObject* element;
6. In the constructor of MyActor.cpp add one element to MyArray
MyArray.Add(element);
7. Compile
8. Create a blueprint based on MyActor (MyActorBP)
9. Add instance of MyActorBP to the level
10. In Visual Studios, add addition elements to MyArray (see step 6)
11. Compile to trigger hot reload in editor
Result:
Blueprint array does not update as more elements are added in code.
Workaround:
Adding a new instance of the blueprint after compile will show correct number of elements
Head over to the existing Questions & Answers thread and let us know what's up.
0 |
Component | UE - Gameplay - Blueprint |
---|---|
Affects Versions | 4.7.6 |
Target Fix | 4.9 |
Created | May 5, 2015 |
---|---|
Resolved | Jun 12, 2015 |
Updated | Apr 27, 2018 |