I have a pawn class written in C++ that has a USphereComponent attached to it like so:
MYCLASSNAME.h
class MYPROJECT_API AMYCLASSNAME : public APawn{
UPROPERTY(BlueprintReadWrite)
USphereComponent* SecondarySphere;
}
MYCLASSNAME.cpp
// Constructor
AMYCLASSNAME::AMYCLASSNAME()
{
// Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
SecondarySphere = CreateDefaultSubobject<USphereComponent>(TEXT("SecondarySphere"));
SecondarySphere->InitSphereRadius(3000.0f);
SecondarySphere->SetSphereRadius(300000.0f);
SecondarySphere->SetupAttachment(RootComponent);
SecondarySphere->OnComponentBeginOverlap.AddDynamic(this, &AMYCLASSNAME::OnSphereComponentOverlap);
SecondarySphere->OnComponentEndOverlap.AddDynamic(this, &AMYCLASSNAME::OnEndSphereComponentOverlap);
}
I’ve played around with a couple of different values for InitSphereRadius, and SetSphereRadius, but neither of them appear to alter the size of the inherited component (on a blueprint child of AMYCLASSNAME). I’m sure I’m missing something simple, but I’m not sure what. Detailed explanations of “why” are appreciated as well as any ideas on how I should troubleshoot this problem.