I originally posted this in the blueprint section, but no one answered me there. It might be more of a C++ problem anyway.
I’m creating a new pawn class in C++ that I want to create specific version of with Blueprints. It’s a simple class for moving a ball around. If I place a blueprint class based on this c++ class the editor crashes when I hit play. It appears that something is wrong with the RootComponent, but I’m not sure what. I’ve been trying for a few days to figure out what is wrong with no progress. Any Help appreciated.
Unknown exception - code 00000001 (first/second chance not available)
Fatal error: [File:\BuildFarm\buildmachine_++depot+UE4-Releases+4.7\Engine\Source\Runtime\Engine\Private\PrimitiveComponent.cpp] [Line: 1401]
Default__BallPawn_Normal_C MovedComponent RootComponent not initialized deleteme 0
KERNELBASE + 37901 bytes
UE4Editor_Core!FOutputDeviceWindowsError::Serialize() + 292 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\private\windows\windowsplatformoutputdevices.cpp:95]
UE4Editor_Core!FMsg::Logf__VA() + 463 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\private\misc\outputdevice.cpp:526]
UE4Editor_Engine!UPrimitiveComponent::MoveComponent() + 1835 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\primitivecomponent.cpp:1401]
UE4Editor_Engine!UMovementComponent::MoveUpdatedComponent() + 123 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\movementcomponent.cpp:440]
UE4Editor_Engine!UMovementComponent::SafeMoveUpdatedComponent() + 167 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\movementcomponent.cpp:460]
UE4Editor_First_1150!UBallPawnMovementComponent::TickComponent() + 2134 bytes [f:\projects\gamedevelopment\unreal\escapeball\source\first\ballpawnmovementcomponent.cpp:121]
UE4Editor_Engine!UActorComponent::ConditionalTickComponent() + 199 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\actorcomponent.cpp:1042]
UE4Editor_Engine!FActorComponentTickFunction::ExecuteTick() + 1001 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\actorcomponent.cpp:602]
UE4Editor_Engine!FTickTaskSequencer::FTickFunctionTask:oTask() + 214 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private icktaskmanager.cpp:322]
UE4Editor_Engine!TGraphTask<FTickTaskSequencer::FTickFunctionTask>::ExecuteTask() + 445 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\public\async askgraphinterfaces.h:671]
UE4Editor_Core!FTaskThread::ProcessTasks() + 3125 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\private\async askgraph.cpp:428]
UE4Editor_Core!FTaskThread::ProcessTasksUntilQuit() + 77 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\private\async askgraph.cpp:271]
UE4Editor_Core!FTaskGraphImplementation::WaitUntilTasksComplete() + 511 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\private\async askgraph.cpp:984]
UE4Editor_Engine!FTaskGraphInterface::WaitUntilTaskCompletes() + 367 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\public\async askgraphinterfaces.h:188]
UE4Editor_Engine!FTickTaskSequencer::ReleaseTickGroup() + 432 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private icktaskmanager.cpp:187]
UE4Editor_Engine!FTickTaskManager::RunTickGroup() + 1182 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private icktaskmanager.cpp:722]
UE4Editor_Engine!UWorld::RunTickGroup() + 102 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\leveltick.cpp:696]
UE4Editor_Engine!UWorld::Tick() + 2971 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\leveltick.cpp:1114]
UE4Editor_UnrealEd!UEditorEngine::Tick() + 5618 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\editor.cpp:1329]
UE4Editor_UnrealEd!UUnrealEdEngine::Tick() + 22 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\unrealedengine.cpp:347]
UE4Editor!FEngineLoop::Tick() + 4179 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launchengineloop.cpp:2257]
UE4Editor!GuardedMain() + 1404 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launch.cpp:142]
UE4Editor!GuardedMainWrapper() + 26 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() + 249 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
UE4Editor!__tmainCRTStartup() + 329 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]
The constructor for the Pawn
ABallPawn::ABallPawn()
{
// 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;
// Our root component will be a sphere that reacts to physics
sphereComponent = CreateDefaultSubobject<USphereComponent>(TEXT("RootComponent"));
RootComponent = sphereComponent;
sphereComponent->InitSphereRadius(40.0f);
sphereComponent->SetCollisionProfileName(TEXT("Pawn"));
// Create and position a mesh component so we can see where our sphere is
sphereVisual = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("VisualRepresentation"));
sphereVisual->AttachTo(RootComponent);
// Create a particle system that we can activate or deactivate
// Use a spring arm to give the camera smooth, natural-feeling motion.
USpringArmComponent* SpringArm = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraAttachmentArm"));
SpringArm->AttachTo(RootComponent);
SpringArm->RelativeRotation = FRotator(-30.f, 0.f, 0.f);
SpringArm->TargetArmLength = 400.0f;
SpringArm->bEnableCameraLag = true;
SpringArm->CameraLagSpeed = 5.0f;
// Create a camera and attach to our spring arm
UCameraComponent* Camera = CreateDefaultSubobject<UCameraComponent>(TEXT("ActualCamera"));
Camera->AttachTo(SpringArm, USpringArmComponent::SocketName);
// Take control of the default player
AutoPossessPlayer = EAutoReceiveInput::Player0;
// Create an instance of our movement component, and tell it to update the root
ourMovementComponent = CreateDefaultSubobject<UBallPawnMovementComponent>(TEXT("CustomMovementComponent"));
ourMovementComponent->UpdatedComponent = RootComponent;
}