In editor when you create blueprint from UMyCharacter, you select class in defaults which can be blueprint, keep in mind that only varables defined in C++ will be accessable (easily, as you could get UProperty and then set and get each, but thats kind of messy to do)
lets say I have a base class and child class,
In My Character class I have a pointer of my base class and want to assign the child class BP from the editor to it, so i want to be able to assign child1, or child2 or child3 to it
,
You just think it does not work? It should work, the template part of NewObject is just to auto cast and if you dont use mroe arguments it sets class to spawn
hmm, I tried it again, but somehow the Object which i created with NewObject<> doesn’t have the values which i set inside the editor. It always has the values from its constructor initializer list.
Ok by anwsering other quastion i think i find fault why it didnt work, first argument is parent and it will accept UClass object too that why you didnt get any error. I fixed the anwser
ok it seems to work
what are the 3rd and 4th parameter for?
(this, SomeClass, NAME_None, 0) these 4 paramters doesn’t work, because there is no matching function call,it works with the first 2 or 3.(this,class) / (this,class,NAME_None)
btw: Are object created with NewObject “garbage collected”?