Unreal-Crash 4.26.2

While compiling

UE_LOG(LogTemp, Warning, TEXT("The name of the object is: %s"), *GetOwner()->GetName());

my unreal engine crashes

my laptop specs are
i5-9300h
GTX 1050 3gb
16 gb ram

unreal is saved in an ssd

Plz help!!!

That sounds like you put that in the constructor which would crash due to GetOwner returning nullptr as the owner doesn’t exist yet.

can you elaborate plz?
and plz tell the solution

You most likely have that in the constructor e.g.

UExample::UExample()
{
    UE_LOG(LogTemp, Warning, TEXT("The name of the object is: %s"), *GetOwner()->GetName());
}

Instead of BeginPlay e.g.

UExample::BeginPlay()
{
    Super::BeginPlay();
    UE_LOG(LogTemp, Warning, TEXT("The name of the object is: %s"), *GetOwner()->GetName());
}

Having that piece of code in the constructor is an issue for the aforementioned reasons (no owner yet). You would need to move that to the appropriate function and recompile which you can do in VS code via

Ctrl + Shift + B > ProjectNameEditor Platform Development Build

Where ProjectName is the name of your project and Platform is the platform you’re targeting e.g. Win64

thanks it worked

1 Like

thanks for the information.

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

Privacy & Terms