Exception thrown when trying to SpawnActor / Access Actor->GetWorld()

This issue has got me scratching my head. I am using UE-5 on a macOS Monterey, 16Gb Mc mini M1.

I am relatively new to C++ & Unreal and I am hitting a wall. I have the start of a game that first generates a 3-d grid of points, the Torus player character can travel on any connector, when it hits a point it can generate a new connection between the points Up/Down/Left/Right/Straight.

This all works and the generation code is below:

void AGridPoints::BuildConnection(AActor* StartPoint, FVector Direction)
{

if(StartPoint != nullptr && StartPoint->GetWorld() != nullptr)
{
UE_LOG(LogTemp, Warning, TEXT(“Got World??”));
StartPoint->GetWorld()->SpawnActor(PointClass);
// FVector Location = StartPoint->GetActorLocation();
// FRotator Rot = Direction.Rotation();
// AActor* SpawnedActor = World->SpawnActor(ConnectorClass, &Location, &Rot);
// SetConnectorSpline(SpawnedActor);
} else
{
UE_LOG(LogTemp, Warning, TEXT(“No World”));
}
}

This is working for the initial level I created, however, I have added the GridPoints Character Blueprints to a new level and it crashes (see trace below).

The StartPoint Actor is the result of a GetWorld()->SweepSingleByChannel

Looking at the logs I see a number of filename not found.

I have been trying to fix this for a while. Any help would be much appreciated.

Caught signal

AGridPoints::BuildConnection(AActor*, UE::Math::TVector) Address = 0x19b3950a1 [/Users/tomberman/Documents/Unreal Projects/GridRunner_PoC/Source/GridRunner_PoC/GridPoints.cpp, line 102] [in UnrealEditor-GridRunner_PoC-0627.dylib]
AGridRunnerCharacter::BuildConnector(UE::Math::TVector) Address = 0x19b396b3b [/Users/tomberman/Documents/Unreal Projects/GridRunner_PoC/Source/GridRunner_PoC/GridRunnerCharacter.cpp, line 97] [in UnrealEditor-GridRunner_PoC-0627.dylib]
AGridRunnerCharacter::BuildConnectorRight() Address = 0x19b3965c4 [/Users/tomberman/Documents/Unreal Projects/GridRunner_PoC/Source/GridRunner_PoC/GridRunnerCharacter.cpp, line 123] [in UnrealEditor-GridRunner_PoC-0627.dylib]
UPlayerInput::ProcessInputStack(TArray<UInputComponent*, TSizedDefaultAllocator<32> > const&, float, bool) Address = 0x11e8e7faf (filename not found) [in UnrealEditor-Engine.dylib]
APlayerController::ProcessPlayerInput(float, bool) Address = 0x11e12d6f7 (filename not found) [in UnrealEditor-Engine.dylib]
APlayerController::TickPlayerInput(float, bool) Address = 0x11e12b061 (filename not found) [in UnrealEditor-Engine.dylib]
APlayerController::PlayerTick(float) Address = 0x11e12a68e (filename not found) [in UnrealEditor-Engine.dylib]
APlayerController::TickActor(float, ELevelTick, FActorTickFunction&) Address = 0x11e13a55f (filename not found) [in UnrealEditor-Engine.dylib]
FActorTickFunction::ExecuteTick(float, ELevelTick, ENamedThreads::Type, TRefCountPtr const&) Address = 0x11c937a0b (filename not found) [in UnrealEditor-Engine.dylib]
FTickFunctionTask::DoTask(ENamedThreads::Type, TRefCountPtr const&) Address = 0x11e83243b (filename not found) [in UnrealEditor-Engine.dylib]
TGraphTask::ExecuteTask(TArray<FBaseGraphTask*, TSizedDefaultAllocator<32> >&, ENamedThreads::Type, bool) Address = 0x11e831c9c (filename not found) [in UnrealEditor-Engine.dylib]
FNamedTaskThread::ProcessTasksNamedThread(int, bool) Address = 0x10ee40249 (filename not found) [in UnrealEditor-Core.dylib]
FNamedTaskThread::ProcessTasksUntilQuit(int) Address = 0x10ee3e800 (filename not found) [in UnrealEditor-Core.dylib]
FTaskGraphCompatibilityImplementation::ProcessThreadUntilRequestReturn(ENamedThreads::Type) Address = 0x10ee3d00f (filename not found) [in UnrealEditor-Core.dylib]
FTaskGraphCompatibilityImplementation::WaitUntilTasksComplete(TArray<TRefCountPtr, TSizedInlineAllocator<4u, 32, TSizedDefaultAllocator<32> > > const&, ENamedThreads::Type) Address = 0x10ee3d5ab (filename not found) [in UnrealEditor-Core.dylib]
FTickTaskSequencer::ReleaseTickGroup(ETickingGroup, bool) Address = 0x11e829e8b (filename not found) [in UnrealEditor-Engine.dylib]
FTickTaskManager::RunTickGroup(ETickingGroup, bool) Address = 0x11e8235f6 (filename not found) [in UnrealEditor-Engine.dylib]
UWorld::Tick(ELevelTick, float) Address = 0x11d5d395f (filename not found) [in UnrealEditor-Engine.dylib]
UEditorEngine::Tick(float, bool) Address = 0x130d3255b (filename not found) [in UnrealEditor-UnrealEd.dylib]
UUnrealEdEngine::Tick(float, bool) Address = 0x131920038 (filename not found) [in UnrealEditor-UnrealEd.dylib]
FEngineLoop::Tick() Address = 0x10481f102 (filename not found) [in UnrealEditor]
GuardedMain(char16_t const*) Address = 0x10482c992 (filename not found) [in UnrealEditor]
-[UEAppDelegate runGameThread:] Address = 0x104848033 (filename not found) [in UnrealEditor]
-[FCocoaGameThread main] Address = 0x10f0b0561 (filename not found) [in UnrealEditor-Core.dylib]
Unknown() Address = 0x7ff81e7149c4 (filename not found) [in Foundation]
_pthread_start Address = 0x7ff81d8bd4e1 (filename not found) [in libsystem_pthread.dylib]
thread_start Address = 0x7ff81d8b8f6b (filename not found) [in libsystem_pthread.dylib]

I finally solved this issue. I had a stale reference in the BluePrints to the GridPoints, for some reason this is tied to the level?? So the reference was not available, hence the crash.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.