I’m trying to figure out why this breakpoint is occurring. This is in the constructor to my player character. I’m on version 4.1
CollisionComponent = PCIP.CreateDefaultSubobject<USphereComponent>(this, ADefaultPawn::CollisionComponentName);
CollisionComponent->InitSphereRadius(35.0f);
CollisionComponent->BodyInstance.bEnableCollision_DEPRECATED = true;
static FName CollisionProfileName(TEXT("Pawn"));
CollisionComponent->SetCollisionProfileName(CollisionProfileName);
CollisionComponent->CanBeCharacterBase = ECB_No;
CollisionComponent->bShouldUpdatePhysicsVolume = true;
SpringArm = PCIP.CreateDefaultSubobject<USpringArmComponent>(GetOuter(), TEXT("SpringArm0"));
SpringArm->SetRelativeRotation( FRotator(0.f, 0.f, 0.f));
SpringArm->AttachTo(RootComponent);
SpringArm->TargetArmLength = 500.0f;
MovementComponent = PCIP.CreateDefaultSubobject<UFloatingPawnMovement>(this, ADefaultPawn::MovementComponentName);
MovementComponent->UpdatedComponent = CollisionComponent;
RootComponent = CollisionComponent;
Camera = PCIP.CreateDefaultSubobject<UCameraComponent>(GetOuter(), TEXT("Camera0"));
Camera->AttachTo(SpringArm, USpringArmComponent::SocketName);
Camera->bUseControllerViewRotation = false;
Camera->FieldOfView = 75.f;
If I leave the line RootComponent = CollisionComponent; at the end of the Movementcomponent/springarm block then I encounter only one breakpoint. It takes me to OutputDevice.cpp line 214 (specifically after pressing play in the editor). I’m not quite sure why. If I move the line RootComponent = CollisionComponent; to be between the definition of SpringArm and the end of the CollisionComponent block then I encounter a ton of breakpoints(to many to list, also before I press play in the editor). If I comment out the line RootComponent = CollisionComponent; then no breakpoints are encountered and my movement no longer works.
If I continue after encountering the breakpoint the game runs fine.
Has anyone else run into a similar issue or knows where to go from here. It works but I’d rather not have to leave something faulty in because the engine is able to handle a mistake I made in my code.
Thanks