How can I attach 2 actor components?

The easiest way is just to parent the capsule under the static mesh. You do this by just dragging the capsule and dropping in on the static mesh in the heirachy.

Hi, my actor has 2 components

1 static mesh component and another capsule component.

The static mesh component is responsible for physics simulation and the capsule component is used for another specific action non-related to physics.

I want the capsule component to stay attached to the static mesh component.
I have added the capsule component by code and static mesh component by blueprints. So the capsule component is the root.

One solution i can think of is moving the capsule component in each tick update to the location of static mesh component. But that would require to add the static mesh component by code. Is their an easier solution for this?

I couldn’t do it as the capsule was the root component.

So I had to code it. Something like this and worked.

	BaseMesh = PCIP.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("BaseMesh"));		// only the owning player will see this mesh
	RootComponent = BaseMesh;
	FVector NewScale(1.5, 1.5, 0.25);
	BaseMesh->SetRelativeScale3D(NewScale);

	CollisionComp = PCIP.CreateDefaultSubobject<UCapsuleComponent>(this, TEXT("CapsuleComp"));
	CollisionComp->InitCapsuleSize(90, 170);
	CollisionComp->BodyInstance.SetCollisionProfileName("OverlapAll");
	CollisionComp->OnComponentBeginOverlap.AddDynamic(this, &ATeleporter::OnOverlap);		// set up a notification for when this component overlaps something
	CollisionComp->AttachParent = BaseMesh;