Sorry for such a basic question. I’ve searching in the doc, the forum, but dont find the correct search terms and I’m stuck.
I’m in the doc and all syntaxe I find and try didnt work.
Really basic trouble :
- Create a Actor class Cloison
- Create a Actor class Cellule
in Cellule, I want a new Cloison
ACloison MyCloison = ACloison();
ACloison MyCloison = ACloison::ACloison();
=> Compile error , Acloison::Acloison is private (in fact,no, it is in a public bloc)
I’ve seen that for some Unreal object, NewObject is used
ACloison* MyCloison = NewObject<ACloison>();
=> Compile, but Unreal crash when I put my Cellulle in the level editor.
ACloison* cloison = Cast<ACloison>();
Compiler can’t cast
ACloison* cloison = new ACloison();
I’ve seen for other object CreateDefaultSubobject() that I use on another class for creating a mesh
Compile, but same crash
If you have a few seconds to give me the correct syntax, or a link for this basic things, you’ll save me a great amout of time
How tho make a new object, and the rule to use NewObject and CreateDefautSubObject ?