C++ - Extending and Initializing UObjects.
I created a third person template project (C++), added a few classes, and I'm now trying to call a function of one of these newly added classes. I can call that function NP through C++ IF the class do not extend UObject. If it does, UE simply crashes when the function is called. I need it to extend UObject because I need to retrieve some variables, as well as execute some functions, from blueprints.
The error I'm getting when hitting the function while its holding class is a child of UObject: http://puu.sh/oAFag/198a3e5465.png
The function triggering the UE4 crash when called while its class extends UObject:
It likely is something pretty simple yet I can't seem to figure it out. Been trying on and off for a few days but being new to both Unreal and C++, I'm struggling.
If you get crash, check logs in Saved/Logs it should also apper in output tab... because you error is very simple and engine should inform you :p
You can't use "new" on UObject, they have diffrent creation process, to instatiate UObject use this insted:
You also should not use delete on UObject, you can only use those on non-UObject and non-reflected objects
Follow this question
Once you sign in you will be able to subscribe for any updates here