Hey, have a class where I add a SkeletalMeshComponent as root component. It shows up but has no collision.
- a physics asset exists for the mesh and it is assigned (verified by opening mesh in content browser)
- if i drag the mesh into the level collision works as expected
This is the code for assigning the SkeletalMeshComponent as actor RootComponent. It works perfectly for StaticMeshComponents but I must be missing an extra step for SkeletalMeshComponent?
// create new component
T* newMesh = CreateDefaultSubobject<T>(FName(*uniqueName));
// set as root
RootComponent = newMesh;
// find mesh in content and assign to component
ConstructorHelpers::FObjectFinder<USkeletalMesh> newAsset(ANSI_TO_TCHAR(meshAssetName));
if (newAsset.Succeeded())
{
((USkeletalMeshComponent*)newMesh)->SetSkeletalMesh(newAsset.Object);
}