USceneComponet, USkeletalMeshComponent, and PhysicsAsset

anonymous_user_537a337d
Sat, 30 May 2020 00:56:41 +0000
World Creation

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.

1 post - 1 participant