# C++ and Blueprint TArray not compatible

**URL:** <https://forums.unrealengine.com/t/c-and-blueprint-tarray-not-compatible/351090>\
**Category:** Blueprint\
**Tags:** unreal-engine, question, Blueprint, CPP\
**Created:** [March 19, 2016, 10:08pm UTC](https://forums.unrealengine.com/t/c-and-blueprint-tarray-not-compatible/351090 "2016-03-19T22:08:33Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_46ac01051](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_46ac01051](https://forums.unrealengine.com/u/anonymous_user_46ac01051)\
**Post date:** [March 19, 2016, 10:08pm UTC](https://forums.unrealengine.com/t/c-and-blueprint-tarray-not-compatible/351090/1 "2016-03-19T22:08:33Z")

</div>

So I defined a TArray in C++. Than I used it in a Blueprint, but everytime i recompile the class where the array is included i have to reapply all connections in the Blueprint…

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/d/a/dad3e7d0ed12606c4dfede6a33cbe03797117665.jpeg)  
Do u have a solution for it?  
How can i keep the links when i recompile the file…

---

<div class="post-metadata">

**Author:** ![BrUnO\_XaVIeR](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bruno_xavier/32/1110230_2.png) [@BrUnO\_XaVIeR](https://forums.unrealengine.com/u/BrUnO_XaVIeR)\
**Post date:** [March 19, 2016, 11:14pm UTC](https://forums.unrealengine.com/t/c-and-blueprint-tarray-not-compatible/351090/2 "2016-03-19T23:14:52Z")

</div>

Show how you do things in c++ land.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_46ac01051](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_46ac01051](https://forums.unrealengine.com/u/anonymous_user_46ac01051)\
**Post date:** [March 20, 2016, 1:41pm UTC](https://forums.unrealengine.com/t/c-and-blueprint-tarray-not-compatible/351090/3 "2016-03-20T13:41:15Z")

</div>

UPROPERTY(BlueprintReadWrite, Category = “Inventory”)  
TArray Inventory;

USTRUCT(BlueprintType)  
struct FInventoryData  
{  
GENERATED\_USTRUCT\_BODY();

```
UPROPERTY(BlueprintReadOnly, Category = "Actor")
	class ABasicPickUp* ActorReference;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "InventoryInformations")
	UTexture2D* ItemImage;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "InventoryInformations")
	FText InformationText;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "InventoryInformations")
	FText UseActionText;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "InventoryInformations")
	uint32 bIsSingleUseOnly : 1;

FInventoryData()
{
	ActorReference = NULL;
	ItemImage = NULL;
	InformationText = FText::GetEmpty();
	UseActionText = FText::GetEmpty();
	bIsSingleUseOnly = false;

}

```

};

---

<div class="post-metadata">

**Author:** ![MiKom](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MiKom](https://forums.unrealengine.com/u/MiKom)\
**Post date:** [March 20, 2016, 3:18pm UTC](https://forums.unrealengine.com/t/c-and-blueprint-tarray-not-compatible/351090/4 "2016-03-20T15:18:22Z")

</div>

It seems that you may have hit a bug in blueprint virtual machine and/or compiler.

I’d recommend stripping the project to the minimum that shows the bug and posting it again as a question of type “bug” with the project attached.

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [March 20, 2016, 4:55pm UTC](https://forums.unrealengine.com/t/c-and-blueprint-tarray-not-compatible/351090/5 "2016-03-20T16:55:30Z")

</div>

Do you maybe use hot reload? If yes, did you try restarting editor? hot reload is sometimes buggus and bugs out reflection data which is essential for bluepritn compilation. Even so it is a bug so i change category Bug Raport

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_46ac01051](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_46ac01051](https://forums.unrealengine.com/u/anonymous_user_46ac01051)\
**Post date:** [March 20, 2016, 5:20pm UTC](https://forums.unrealengine.com/t/c-and-blueprint-tarray-not-compatible/351090/6 "2016-03-20T17:20:06Z")

</div>

Gonna upgrade to UE version 4.10… Maybe there it is solved 🙂

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [March 21, 2016, 7:55pm UTC](https://forums.unrealengine.com/t/c-and-blueprint-tarray-not-compatible/351090/7 "2016-03-21T19:55:09Z")

</div>

Hey nonimus-

After testing, this appears to be an issue with hot reloading and specifically an array of structs (using an array of floats/bools did not behave the same). I submitted a bug report (UE-28600) for investigation, however as mentioned - if you close the editor before compiling the nodes will remain intact after relaunching the editor.

Cheers

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_46ac01051](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_46ac01051](https://forums.unrealengine.com/u/anonymous_user_46ac01051)\
**Post date:** [March 21, 2016, 9:45pm UTC](https://forums.unrealengine.com/t/c-and-blueprint-tarray-not-compatible/351090/8 "2016-03-21T21:45:30Z")

</div>

Anything I can do to help solve the error or something I should do with the Bug-Report Code? 😛
