Pointer to UObject and Inheritance in BP/C++
Hi, here is my WTR story (UE4 4.10.1):
Result - nothing to select. But as we remember in step 1 we've created SINGLE2 object. Same situation with any c++ approaches (via direct pointer to any SINGLE2 object) except of TSubObject, but it's not what i'm looking for :)
What i'm doing wrong (i want to be able to select SINGLE2 object)? Thank you :)
Creating a variable of a given type does not create an instance of that type when it's a pointer. It creates a pointer (int) to that type. All UObject (and its descendants) variables are pointers.
Calling it a reference is misleading. It is not a reference (&), it is a pointer.
To have an object selectable in the dropdown, it would need to be in the content browser. It is not possible to create UObjects (or any of its subclasses) in the content browser, except for specific asset classes, such as UStaticMesh or UTexture.
It's not asset it's class. How I understand it, assets are things you can place to the world/BP, you made a class you need to construct like other basic classes, so you need create instance of class :)
Just tried it in editor and you need Event/Function after creation if you want it keep it on OOP way.
I made it your way just classes are named "TestClass" and "TestClass2", hope it help. :)
answered Dec 25 '15 at 07:14 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here