When I put a SkeletalMeshComponent under a SceneComponent the PhysicsAsset stops working. This may be due to a combination of the two in use with a PawnMovementComponent.
This works:
SkeletalMeshComponent = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("SkeletalMeshComponent"));
SkeletalMeshComponent->SetNotifyRigidBodyCollision(true);
SkeletalMeshComponent->SetGenerateOverlapEvents(true);
RootComponent = SkeletalMeshComponent;
MoveItComponent = CreateDefaultSubobject<UPawnMovementComponent>(TEXT("MoveItComponent"));
MoveItComponent->UpdatedComponent = RootComponent;
This does not:
MySceneComponent = CreateDefaultSubobject<USceneComponent>(TEXT("MySceneComponent"));
RootComponent = MySceneComponent;
SkeletalMeshComponent = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("SkeletalMeshComponent"));
SkeletalMeshComponent->SetupAttachment(RootComponent);
Should this work? Am I doing something wrong?
When the SceneComponent is created and the SkeletalMeshComponent is added to it collisions stop working. I’ve tried setting the SkeletalMeshComponent to the UpdatedComponent too when it is a child of the scene component but that doesn’t help either.