Hi,
I am attempting to create a Projectile class in C++, which inherits Actor. The Projectile class has a Static Mesh Component called ProjectileMesh which I want to be able to set in any Blueprint which inherits Projectile.
However, my problem is that the Static Mesh Component (ProjectileMesh) created in c++ looks very different from one added manually to a blueprint, when viewed in the editor. To me it looks like a completely different class.
I create the mesh using the following code:
.h:
/** Primary projectile mesh */
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = Components)
UStaticMeshComponent* ProjectileMesh;
.cpp:
ProjectileMesh = ObjectInitializer.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("ProjectileMesh"));
ProjectileMesh->AttachTo(RootComponent);
This is what the ProjectileMesh created in C++ looks like when viewed in the editor. Pay attention to the Details pane:
And this is what the Details pane of a Static Mesh Component looks like when added manually to a blueprint:
As you can see, not only does the layout look very different, the component created in C++ is also missing, for example, the Physics section.
I have tried re-creating the blueprint class that inherits from the C++ class. If it matters, I am running UE 4.7.4.