Building Escape Crashing when I load project

When I launch the project it crashes and sends a crash report:

here’s the crash report:

LoginId:b92c1009448c4a249df30f92b5785f8a
EpicAccountId:bfaba16677754e23aed9ee4d4f6e21ac

Unhandled exception

UE4Editor_BuildingEscape_2933!UOpenDoor::UOpenDoor() [C:\Users\budgi\OneDrive\Desktop\GameFolder\UdemyUnrealClass\BuildingEscape\Source\BuildingEscape\OpenDoor.h:28]
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_Core
UE4Editor_Core
UE4Editor_Projects
UE4Editor_Projects
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
kernel32
ntdll

The line that is giving the error (28) doesn’t even have anything on it anymore. I edited it to try and fix the error, but then I realized that I can’t compile it, so it keeps trying to run the messed up version. What should I do?

If you can’t compile, then you’ve got an error in your code. Seeing your code and the error you’re getting would be helpful.

Could you show your code?

Here is the OpenDoor.cpp:

// Called when the game starts

void UOpenDoor::BeginPlay()

{

    Super::BeginPlay();

    InitialYaw = GetOwner()->GetActorRotation().Yaw;

    CurrentYaw = InitialYaw;

    TargetYaw = InitialYaw + 90;

        

}

// Called every frame

void UOpenDoor::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)

{

    Super::TickComponent(DeltaTime, TickType, ThisTickFunction);

    // FRotator OpenNinety = GetOwner()->GetActorRotation();

    // OpenNinety.Yaw = OpenNinety.Yaw + 90.f;

    // GetOwner()->SetActorRotation(OpenNinety);

    UE_LOG(LogTemp, Warning, TEXT("%s"), *GetOwner()->GetActorRotation().ToString());

    UE_LOG(LogTemp, Warning, TEXT("The Yaw of the Door is: %f"),GetOwner()->GetActorRotation().Yaw);

    CurrentYaw = FMath::InterpTo(CurrentYaw, TargetYaw, DeltaTime, 45);

    FRotator DoorRotation = GetAOwner()->GetActorRotation();

    DoorRotation.Yaw = CurrentYaw;

    GetOwner()->SetActorRotation(DoorRotation);

}

and the OpenDoor.h:

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"

#include "Components/ActorComponent.h"

#include "OpenDoor.generated.h"

UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )

class BUILDINGESCAPE_API UOpenDoor : public UActorComponent

{

    GENERATED_BODY()

public: 

    // Sets default values for this component's properties

    UOpenDoor();

protected:

    // Called when the game starts

    virtual void BeginPlay() override;

public: 

    // Called every frame

    virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;

private:

    float InitialYaw;

    float CurrentYaw;

    float TargetYaw = 90;

        

};

However, like I said, I changed the code since it began crashing, but I cannot compile it because it never opens the editor, so that is the reason, I believe, it keeps returning the error. But maybe I am missing something else as well

Well if you haven’t compiled the code since making those changes then it’s not going to loading that. Unreal loads the compiled binary not your code.

To compile outside of the editor using VS Code use

Ctrl + Shift + B > ProjectNameEditor Platform Development Build

Platform being the platform you’re building e.g. Win64. Also be sure it’s the editor version you’re building.


With that said it doesn’t look like your code would compile because you have declared a constructor but didn’t define it.

I Do? Is that a variable in the .h or .cpp? Sorry I am still trying to figure this out

Also Which build do I use? When I hit Ctrl+Shift+B and type in BuildingEscape Win64 it gives me multiple build options like: Clean, build, rebuild and with different prefixes like debug, Test, or shipping

What are you referring to here?

I already stated in my previous comment.

BuildingEscapeEditor Win64 Development Build

which constructor did I declare but not define?

In your header you have

UOpenDoor();

But then there’s no definition of it in your cpp.

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

Privacy & Terms