Fatal Error?

When I first start the launcher and hit play to test the game like I normally do when I start my launcher It just crashes instantly, I didn’t click on anything to make it crash but it closes and brings me to the Crash Report? please help I am going to keep trying to get it to work and figure out how to take a screenshot so I can paste it in a reply.

Section 3 - Lesson 75 actually my bad

So the lecture titled “LineTraceSingleByObjectType()”? You most likely have a nullptr exception check to make sure you check against potential null pointers like

AActor* ActorHit = Hit.GetActor();
if (ActorHit)
{
	UE_LOG(LogTemp, Warning, TEXT("Line trace hit: %s"), *(ActorHit->GetName()))
}

How does that fix the crashing, I haven’t actually done the lesson 75 because I can’t test to see if my previous work has worked.

If ActorHit is nullptr then accessing it’s members, like GetName(), will throw a null pointer exception.

which causes the game to not close when I hit “Play”?

You mean it will close? If it’s nullptr without that check it will crash because you are trying to access members on a null pointer. If you check to see if it points to something first then ActorHit->GetName() won’t cause the crash.

I have to click “Play” in order to see the objects in the output log like when it says “model/cube 4x4 at -923.45 5252” things like that but it also gives me 2 errors when i try to rebuild the game in Visual Studios I’ll paste those 2 errors in this chat

could it be that I have too much stuff on the game?

You aren’t informing me on what problems you are now facing… And probably no.

the only reason I think that it could be having too much stuff is because other things I have made with unreal has worked but BuildingEscape one just stopped working.

Still don’t know what your current problem is…

I am going to try a couple of things but if it doesn’t work I’ll make another Ticket for help, but thank you for trying Dan. :slight_smile:

I just got it working again I missed the “if (ActorHit)” in the code lol

Privacy & Terms