UE Crashing when changing TargetYaw to UProperty

Hi,
I was changing the parameter TargetYaw to UPROPERTY(EditAnywhere) and Unreal crashed.
I had it written as UProperty and it didn’t crash but the Editor didn’t show the TargetYaw.
Since I changed it to Uppercase, it keeps crashing every time I try to open it.
Is there any way to go into the code and remove that line?
This is the list of errors that comes up when it crashes.
"
Assertion failed: [File:D:\Build++UE4\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp] [Line: 2507] UObject(const FObjectInitializer&) constructor called but it’s not the object that’s currently being constructed with NewObject. Maybe you are trying to construct it on the stack, which is not supported.

UE4Editor_Core
UE4Editor_Core
UE4Editor_Core
UE4Editor_Core
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_BuildingEscape_7680!UOpenDoor::UOpenDoor() [d:\users\user\documents\unreal projects\buildingescape\source\buildingescape\opendoor.cpp:12]
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_Core
UE4Editor_Core
UE4Editor_Projects
UE4Editor_Projects
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
kernel32
ntdll"
Any ideas?
Sinead

Could you show your header file and cpp?

Here they are:

Thanks,Sinead

Are you using this component in C++ by any chance?

Hi Dan,
I’m not sure what you mean. Its the same way that the OpenDoor was added as a component in the material, via the Editor.
Sinead

I have deleted the code TargetYaw , CurrentYaw etc from the Visual Studio Code and UE is still crashing.
Do I need to start Building Escape from the beginning?
line 12 in OpenDoor.cpp is showing as the error.
“PrimaryComponentTick.bCanEverTick = true;”

UE4Editor_BuildingEscape_7680!UOpenDoor::UOpenDoor() [d:\users\user\documents\unreal projects\buildingescape\source\buildingescape\opendoor.cpp:12]

Thanks,
Sinead

Probably not then. As in another class or any other code e.g.

class SomeOtherComp : public UActorComponent
{
public:
    UOpenDoor* DoorComp;
};

Or

void USomeClass::SomeFunc()
{
    UOpenDoor* Door;
}

Because the message from your OP suggests you are and that you’re not using a pointer e,g,

UOpenDoor Door;

That is creating a UOpenDoor on the stack which is not allowed for UObject types.

Hi Dan,
No I had none of that code in my code yet.
I had only reached the " Exposing Parameters To The Editor" material in the course.
Do I need to start again then?
Thanks,
Sinead

You could recreate the class (delete files on disk, refresh project files, compile, create), restart the project, or send me your project to see what’s up (File > Package Project > Zip Up Project)

Hi Dan,
I can’t get to that stage, UE loads the game to 100% and then crashes.
I have zipped it in the backend, to 311MB.
How can I share the file with you?
The Upload section only allows jpegs/image files.
Thanks,
Sinead

Just use a host like Google Drive and link it.

Hi Dan, here you go:
I put in the original code that crashed it, line 33 & 34 of header file
https://studentdkit-my.sharepoint.com/:u:/g/personal/d00216814_student_dkit_ie/EaWRHgpuUGZBlAso9lu65CEBlHCSLoYi01dr560e8qhetw?e=fi9kQQ

Sinead

  1. Add the missing semicolon on the end of the class declaration in OpenDoor.h
  2. Delete your Binaries and Intermediate folders then reopen your project rebuilding when prompted.

Hi Dan, sorry I didn’t get this notification for some reason. Will try it tomorrow.Thanks.Sinead

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

Privacy & Terms