# Passing USTRUCT() reference to Blueprint

**URL:** <https://forums.unrealengine.com/t/passing-ustruct-reference-to-blueprint/341611>\
**Category:** Editor Scripting\
**Tags:** ustruct, unreal-engine, UE4, CPP, question, Blueprint\
**Created:** [December 16, 2015, 11:50am UTC](https://forums.unrealengine.com/t/passing-ustruct-reference-to-blueprint/341611 "2015-12-16T11:50:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Unteroid](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Unteroid](https://forums.unrealengine.com/u/Unteroid)\
**Post date:** [December 16, 2015, 11:50am UTC](https://forums.unrealengine.com/t/passing-ustruct-reference-to-blueprint/341611/1 "2015-12-16T11:50:50Z")

</div>

How can I pass USTRUCT() reference from a C++ class to it’s child blueprint?  
I have my USTRUCT() defined in a separate header.

In my AActor c++ class header I make a forward declaration on structure

```
	struct FSymbolInfo* SymbolProperties;

```

and in source file I actually include structure header and fill it’s fields with data.

How can I access USTRUCT() data with a BP?

USTRUCT() is defined separately:

```
USTRUCT(BlueprintType)
struct TWODSIDESCROLLER_API FSymbolInfo
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SymbolProperties")
		FString SymbolName;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SymbolProperties")
		float SymbolLength;

		FSymbolInfo()
	{

	}
};
```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_41845f4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41845f4a](https://forums.unrealengine.com/u/anonymous_user_41845f4a)\
**Post date:** [December 16, 2015, 8:32pm UTC](https://forums.unrealengine.com/t/passing-ustruct-reference-to-blueprint/341611/2 "2015-12-16T20:32:08Z")

</div>

Hello Unteroid,

What exactly do you want to do with the reference when you get it to blueprint? You should be able to just create an variable of the struct’s type and make that variable a UProperty. It’ll then show up as one of the blueprint’s properties and will reflect any data you’ve put into it.

You will run into issues if you try to create a UProperty of a UStruct with forward declaration along however. You’ll need to include the file where this UStruct is being declared. This is due to how structs are parsed.

---

<div class="post-metadata">

**Author:** ![Unteroid](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Unteroid](https://forums.unrealengine.com/u/Unteroid)\
**Post date:** [December 17, 2015, 6:39am UTC](https://forums.unrealengine.com/t/passing-ustruct-reference-to-blueprint/341611/3 "2015-12-17T06:39:19Z")

</div>

Making structure available with UPROPERTY() worked, weird I didn’t try that.  
I didn’t want to declare struct in header because I don’t really like to pollute it.

I did want to make pointer to struct as UPROPERTY() and allocate memory later in the constructor as we do with components.
