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:
Shelve = ConstructObject<UStaticMeshComponent>(UStaticMeshComponent::StaticClass(), this, FName(TEXT("ShelveMesh"))); Shelve->CreationMethod = EComponentCreationMethod::UserConstructionScript; Shelve->AttachTo(GetRootComponent()); Shelve->SetRelativeRotation(FRotator(0, 90, 0)); Shelve->SetStaticMesh(ShelveMesh); Shelve->RegisterComponent();
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)