I am trying to add a new capsule component in c++
Code is as follows:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = LedgeGrab, meta = (AllowPrivateAccess = "true"))
class UCapsuleComponent* LedgeGrabCapsule;
and Implementation:
LedgeGrabCapsule = CreateDefaultSubobject<UCapsuleComponent>(TEXT("LedgeGrabCapsule"));
LedgeGrabCapsule->InitCapsuleSize(70, 120);
LedgeGrabCapsule->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
LedgeGrabCapsule->OnComponentBeginOverlap.AddDynamic(this, &ABSNOneCharacter::OnLedgeGrabOverlapBegin);
LedgeGrabCapsule->OnComponentEndOverlap.AddDynamic(this, &ABSNOneCharacter::OnLedgeGrabOverlapEnd);
LedgeGrabCapsule->AttachTo(RootComponent);
The capsule seems to be drawn relative to the root capsule in the blueprint editor, but is positioned well forward of and below the character in the editor and the running game.
I have added another capsule through blueprint which appears in the correct position in all views.
Could someone point out what I am missing here?
I have tried various attempts to set transforms, locations etc to no avail.
Image of editor views below: