Hi. I have created a dataset system that consists of pure UObjects in a hierachy.
So GI has an objA which has an objB and a set of multiple objC. (It’s much more complex than this, but just for giving an oveview).
When i want to create another objC, i try using:
UObjC* obj = NewObject();
But in game it returns something completely off, or crashes entirely. I have looked around but can’t seem to find how to create an UObject through c++ only. Posts talk about components, actors etc. which confuses me. I just want to create an instance of a UObject.
Atm, i am using BlueprintImplementableEvent, where i create and add them. However to do this i must each time make a BP_objC child class and do it in BP so i can “Construct object of class” and set it as variable, which is a poor solution.
What is the right way to create an instance of a UObject?
Hope you can help Thanks in advance.
I have been fighting his for 2 days now, so don’t feel more clever than before.
Should this method ALWAYS work, or why do some add “this” and this “StaticClass” thing. Are there specific situations where i need to add this?