# BP Subclass of a BP blows away array of BP asset references inherited from parent

**URL:** <https://forums.unrealengine.com/t/bp-subclass-of-a-bp-blows-away-array-of-bp-asset-references-inherited-from-parent/307449>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [February 19, 2015, 5:27pm UTC](https://forums.unrealengine.com/t/bp-subclass-of-a-bp-blows-away-array-of-bp-asset-references-inherited-from-parent/307449 "2015-02-19T17:27:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_7c3b416f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7c3b416f](https://forums.unrealengine.com/u/anonymous_user_7c3b416f)\
**Post date:** [February 19, 2015, 5:27pm UTC](https://forums.unrealengine.com/t/bp-subclass-of-a-bp-blows-away-array-of-bp-asset-references-inherited-from-parent/307449/1 "2015-02-19T17:27:42Z")

</div>

This is driving me utterly bananas.

I have a actor class in C++, ABiome. This is intended as a configuration class for a section of gameplay.  
In this class are a couple members

```
UClass(...)
class ABiome : public AActor
{
    GENERATED_UCLASS_BODY()

    ...

     UPROPERTY(BlueprintReadOnly, EditAnywhere, Category="Islands")
    TArray<TSubclassOf<AIsland>> Islands
    UPROPERTY(BlueprintReadOnly, EditAnywhere, Category="Islands")
    TArray<TSubclassOf<AIsland>> Shores

    ...

}

```

i.e. this class contains an array of actor BP references (there are actually several such arrays for different types of actor BP references).

In content I have a Master\_biome which inherits from ABiome. In Master\_biome, I populate these arrays with maybe 20 entries and 4 entries respectively.

Then I create a child. Intro\_biome.

When first created, the Intro\_biome correctly shows all the entries in the inherited list. However, after a few shut-downs and re-starting of the engine, the list in the child gets blown away. In some cases the array is truncated to zero length, in other cases, the entries in the list themselves are cleared – but often not all of them.

One hint: this only seems to happen once the Master\_biome and Intro\_biome are actually referenced by another asset. When unreferenced, everything works fine. When referenced. all hell breaks loose.

This might sound like a complicated setup, but it really isn’t. I need the child BP, intro\_Biome to override a small subset of the params in the Master\_biome but not the various lists of islands. However, I cannot find any way to preserve the inheritance of those BP references reliably.

---

<div class="post-metadata">

**Author:** ![MickD777](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MickD777](https://forums.unrealengine.com/u/MickD777)\
**Post date:** [February 19, 2015, 5:31pm UTC](https://forums.unrealengine.com/t/bp-subclass-of-a-bp-blows-away-array-of-bp-asset-references-inherited-from-parent/307449/2 "2015-02-19T17:31:17Z")

</div>

My guest would be that you are missing the UPROPERTY() macro. If you don’t have that, the garbage collection can pass on that and think it,s not referenced anywhere and delete those. Always use UPROPERTY() !

```
UPROPERTY()
TArray<TSubclassOf<AIsland>> Islands
UPROPERTY()
TArray<TSubclassOf<AIsland>> Shores
```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_7c3b416f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7c3b416f](https://forums.unrealengine.com/u/anonymous_user_7c3b416f)\
**Post date:** [February 19, 2015, 5:36pm UTC](https://forums.unrealengine.com/t/bp-subclass-of-a-bp-blows-away-array-of-bp-asset-references-inherited-from-parent/307449/3 "2015-02-19T17:36:34Z")

</div>

No, the UPROPERTY macros are there (just added them to the post). Sorry I forgot to include them in my hasty copy-pasting into this thread.

---

<div class="post-metadata">

**Author:** ![MickD777](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MickD777](https://forums.unrealengine.com/u/MickD777)\
**Post date:** [February 19, 2015, 5:50pm UTC](https://forums.unrealengine.com/t/bp-subclass-of-a-bp-blows-away-array-of-bp-asset-references-inherited-from-parent/307449/4 "2015-02-19T17:50:31Z")

</div>

Hum, ok. Have you tried not using SubclassOf and only using AIsland\* ? I have no real reason to think it would change anything, but maybe something to try. It will show all subclass anyway.

---

<div class="post-metadata">

**Author:** ![Nick\_Whiting](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nick\_Whiting](https://forums.unrealengine.com/u/Nick_Whiting)\
**Post date:** [February 19, 2015, 9:41pm UTC](https://forums.unrealengine.com/t/bp-subclass-of-a-bp-blows-away-array-of-bp-asset-references-inherited-from-parent/307449/5 "2015-02-19T21:41:48Z")

</div>

It looks like this is a cyclic dependency issue, causing the properties to be erased because of load order issues. These should be fixed in 4.7, which is coming very soon. Give it a shot there, and if it doesn’t work, we can investigate further!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_7c3b416f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7c3b416f](https://forums.unrealengine.com/u/anonymous_user_7c3b416f)\
**Post date:** [February 19, 2015, 9:58pm UTC](https://forums.unrealengine.com/t/bp-subclass-of-a-bp-blows-away-array-of-bp-asset-references-inherited-from-parent/307449/6 "2015-02-19T21:58:17Z")

</div>

Awesome, thank you so much for the update, Nick. I will look forward to 4.7.
