# Creating new BlueprintTypes in C++

**URL:** <https://forums.unrealengine.com/t/creating-new-blueprinttypes-in-c/3774>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [May 4, 2014, 2:53pm UTC](https://forums.unrealengine.com/t/creating-new-blueprinttypes-in-c/3774 "2014-05-04T14:53:28Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![melak47](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@melak47](https://forums.unrealengine.com/u/melak47)\
**Post date:** [May 4, 2014, 2:53pm UTC](https://forums.unrealengine.com/t/creating-new-blueprinttypes-in-c/3774/1 "2014-05-04T14:53:28Z")

</div>

Hi,

I’m trying to create a new Blueprint type that exposes some members and member functions to Blueprints - no problem here - and allow editing of its properties in the details pane.  
However, if I add a variable of my type to my Actor blueprint and make it editable, the only thing it shows in the details pane is its name and a field saying “None”.  
 ![None=(.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/c/5/dc55aa0858911f0f1bd7046a01daea75d3a2b477.png)

So how do I set proper default values for custom Blueprint types, or what is it that I need to do for it to show it’s properties in the details pane?

Right now I have a UCLASS(BlueprintType) class UMyBPType : public UObject {…}, with all properties marked UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Something).

I know I could turn it into a Component, and then add it in the Components part of the Blueprint, that way it’ll get properly initialized, but most components don’t show their properties on the Blueprint Actor’s details pane either…

---

<div class="post-metadata">

**Author:** ![birdfreeyahoo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@birdfreeyahoo](https://forums.unrealengine.com/u/birdfreeyahoo)\
**Post date:** [May 4, 2014, 3:10pm UTC](https://forums.unrealengine.com/t/creating-new-blueprinttypes-in-c/3774/2 "2014-05-04T15:10:21Z")

</div>

I’m not sure but I think the classes, that Actor(blueprints) are based on must inherit from AActor, UObject is not enough.

---

<div class="post-metadata">

**Author:** ![melak47](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@melak47](https://forums.unrealengine.com/u/melak47)\
**Post date:** [May 4, 2014, 3:16pm UTC](https://forums.unrealengine.com/t/creating-new-blueprinttypes-in-c/3774/3 "2014-05-04T15:16:56Z")

</div>

> [@birdfreeyahoo;27196](#):
>
> I’m not sure but I think the classes, that Actor(blueprints) are based on must inherit from AActor, UObject is not enough.

I don’t want a new base type of Blueprint, I want to create a type blueprints can use in variables

---

<div class="post-metadata">

**Author:** ![iniside](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/iniside/32/866315_2.png) [@iniside](https://forums.unrealengine.com/u/iniside)\
**Post date:** [May 4, 2014, 3:43pm UTC](https://forums.unrealengine.com/t/creating-new-blueprinttypes-in-c/3774/4 "2014-05-04T15:43:34Z")

</div>

BlueprintType is not enough. You also need Blueprintable:

```auto

UCLASS(Blueprintable, BlueprintType)
class URPGEffectBase : public UObject 

```

---

<div class="post-metadata">

**Author:** ![melak47](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@melak47](https://forums.unrealengine.com/u/melak47)\
**Post date:** [May 4, 2014, 4:13pm UTC](https://forums.unrealengine.com/t/creating-new-blueprinttypes-in-c/3774/5 "2014-05-04T16:13:25Z")

</div>

> [@iniside;27214](#):
>
> ```auto
> 
> UCLASS(Blueprintable, BlueprintType)
> class URPGEffectBase : public UObject 
> 
> ```

Hmm, I gave that a try, but it didn’t change anything.  
 ![stillnothing.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/2/8/828f1986efd60607c6e0bfec7e070f2ca49aee91.png)

---

<div class="post-metadata">

**Author:** ![iniside](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/iniside/32/866315_2.png) [@iniside](https://forums.unrealengine.com/u/iniside)\
**Post date:** [May 4, 2014, 4:30pm UTC](https://forums.unrealengine.com/t/creating-new-blueprinttypes-in-c/3774/6 "2014-05-04T16:30:24Z")

</div>

I don’t understrand what you trying to do ?

Class is just well class, you create class variable, and you can plug another blueprint to it with set properties.

Object is object. You spawn object from classes, or create them in level.

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [May 4, 2014, 4:55pm UTC](https://forums.unrealengine.com/t/creating-new-blueprinttypes-in-c/3774/7 "2014-05-04T16:55:12Z")

</div>

**Wiki tutorials**

**Create Blueprint Functions (put them in any UCLASS() you want)**

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

**Create Blueprint-accessible variables in any UCLASS**

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

After trying both of the above tutorials please let us know if there is some other functionality you are looking for

🙂

Rama

---

<div class="post-metadata">

**Author:** ![melak47](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@melak47](https://forums.unrealengine.com/u/melak47)\
**Post date:** [May 4, 2014, 7:31pm UTC](https://forums.unrealengine.com/t/creating-new-blueprinttypes-in-c/3774/8 "2014-05-04T19:31:42Z")

</div>

I know how to create blueprint accessible functions and variables.  
What I want to do is create a class type that has properties and functions, and add one as a variable to a blueprint, and have it visible and editable, just like a bool, struct, whatever variable:

 ![adsfldgh.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/9/3/a934d1f6abca155708d7fc5c1a18b5962a47c708.png)

---

<div class="post-metadata">

**Author:** ![GreenEyed](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GreenEyed](https://forums.unrealengine.com/u/GreenEyed)\
**Post date:** [May 4, 2014, 9:05pm UTC](https://forums.unrealengine.com/t/creating-new-blueprinttypes-in-c/3774/9 "2014-05-04T21:05:09Z")

</div>

Let’s see if I understood correctly.

You have a class AMyClass that has properties and functions

You want to create a blueprint based on that class

You then want to be able to specify that blueprint as a property in another class/blueprint combo so they can be used.

If that’s the case, you can specify it, for example, as:

```auto

UPROPERTY(EditDefaultsOnly, Category=Configuration)
TSubclassOf<AMyClass> MyClass;

```

In the editor, you’ll be able to select in that field any class that extends AMyClass, including the Blueprints that extend it.

And then you can use SpawnActor or ConstructObject on that class. Depending on whether they are actors or just components (you can also “blueprint them”)

Is that what you meant?

S!

---

<div class="post-metadata">

**Author:** ![melak47](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@melak47](https://forums.unrealengine.com/u/melak47)\
**Post date:** [May 4, 2014, 9:20pm UTC](https://forums.unrealengine.com/t/creating-new-blueprinttypes-in-c/3774/10 "2014-05-04T21:20:39Z")

</div>

No, my class is not an actor, I don’t want to spawn it in the world. And I don’t want to base my blueprint on it, I simply want to put one as a variable into a blueprint.

![sadfg.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/4/7/47355f4feaef43a5f2d2be13ada47388544da0f7.png)&d=1399238376

All my class is supposed to do is hold some state, let the user change it on the actor, and calculate stuff with it.

---

<div class="post-metadata">

**Author:** ![GreenEyed](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GreenEyed](https://forums.unrealengine.com/u/GreenEyed)\
**Post date:** [May 4, 2014, 9:41pm UTC](https://forums.unrealengine.com/t/creating-new-blueprinttypes-in-c/3774/11 "2014-05-04T21:41:26Z")

</div>

I’m not sure if you can do what you want: being able to edit the values of the instance of a custom class that is not a blueprint. The usual way we solve that kind of problem is through blueprints that extend that class, in some cases with UPROPERTY(EditInstanceOnly…) so we can have several instances with specific values for each one.

I can’t help you there then, I’m afraid.

Cheers!

PD: I’ve done with Structs of basic properties, but not with any kind of class.

---

<div class="post-metadata">

**Author:** ![melak47](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@melak47](https://forums.unrealengine.com/u/melak47)\
**Post date:** [May 4, 2014, 10:28pm UTC](https://forums.unrealengine.com/t/creating-new-blueprinttypes-in-c/3774/12 "2014-05-04T22:28:51Z")

</div>

Well, I guess I can turn this class into an Actor and make my blueprint extend it - that makes the properties visible in the details pane, and I can call the functions (on myself…).  
But that doesn’t seems right since my class is not an actor, it probably implements none of the interface an AActor should, and it has absolutely nothing to do with being placeable in the world.  
Also, this only works once and seems backwards. There has to be a better way to hook a C++ class into Blueprints? It can show the properties of a struct variable fine, what’s the difference with a class?

---

<div class="post-metadata">

**Author:** ![GreenEyed](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GreenEyed](https://forums.unrealengine.com/u/GreenEyed)\
**Post date:** [May 5, 2014, 6:45pm UTC](https://forums.unrealengine.com/t/creating-new-blueprinttypes-in-c/3774/13 "2014-05-05T18:45:31Z")

</div>

No need for them to be AActors. As I said, they can be simple UObjects. No need to place them in the world, not replicated… If you don’t need all what AActor provides, you can use that as your base for the blueprint.

It works for a Struct of basic types, because it simply has to show a list of fields. If they did it with any kind of class, that class could have members that could also be classes… and that’s way more complicated to handle…

As you say, blueprints have this thing of classes/instances that it is sometimes blurry and I agree it’s not ideal, but I’m just trying to adapt to the mechanisms that UE4 provides :).

---

<div class="post-metadata">

**Author:** ![Dig\_Squid](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dig_squid/32/1145423_2.png) [@Dig\_Squid](https://forums.unrealengine.com/u/Dig_Squid)\
**Post date:** [May 8, 2014, 8:09am UTC](https://forums.unrealengine.com/t/creating-new-blueprinttypes-in-c/3774/14 "2014-05-08T08:09:21Z")

</div>

I think what you are looking for is the ‘custom Structs’ feature coming in 4.2!
