I am trying to implement ConstructionScript on C++, everything is working ok except: The procedurally added stuff are not visible in the components of the pawn. Here is the code I use on OnConstruction:
this runs perfectly and does everything I ask for it to do but as I said, when I click on the pawn, I cannot see this component on the components tab. Creating it on constructor attaches it okay and makes it visible.
On top I am wondering why I just cannot create this object on the construction script then just call Shelve->SetStaticMesh(ShelveMesh); This results in access violation error.
Edit: Reordering stuff did not yield any good results (RegisterComponent especially)
That’s not how you should create component subobjects natively. The ConstructionScript (Simple or User) is a complex construction step really meant to integrate blueprint-created components in as transparent a fashion as possible. When working with C++, you don’t need to do any of this. Use the constructor instead:
There’s also “NewObject” method in case where component must be created in some place other than Constructor. In that case “RegisterComponentWithWorld” call will be also necessary.