I’ve been trying to get a collision box to work this entire day. If I attach the collision box as the root, no problem. If I attach the box to my ship mesh, it moves with the ship, but no collision/block.
I’ve tried everything, blocking all, enabling collision via code, nothing works.
This is how I have my chain:
DummyComponent = PCIP.CreateDefaultSubobject<USkeletalMeshComponent>(this, TEXT("Dummy")); RootComponent = DummyComponent; ShipMeshComponent->AttachTo(RootComponent); ShipMeshComponent->SetSkeletalMesh(ShipMesh.Object); ShipMeshComponent->bAbsoluteScale = true; CollisionComp2 = PCIP.CreateDefaultSubobject<UBoxComponent>(this, TEXT("CollisionComp2")); CollisionComp2->SetCollisionProfileName(CollisionProfileName); CollisionComp2->SetCollisionEnabled(ECollisionEnabled::Type::QueryAndPhysics); CollisionComp2->SetCollisionResponseToAllChannels(ECollisionResponse::ECR_Block); CollisionComp2->AttachParent = ShipMeshComponent;
I’ve looked at
and it did not change anything.
I basically want to move the ship separate from the root because the moving camera is attached to the root
(I’m creating a shmup)
Unless there is a better way to do this.