How to stop UE4 crash after adding UPROPERTY

So if you’re like me in this course, you’ve noticed that whenever we add a UPROPERTY to a class then open up a blueprint that inherits from that class and compile for the first time, Unreal crashes. This would happen every time. After a bit of searching, this doesn’t happen if you put the category in quotes as a string rather than straight in the code, like so:

Wrong way (compiles fine, but makes it crash):
UPROPERTY(EditDefaultsOnly, Category = Firing)

Right way (no crash):
UPROPERTY(EditDefaultsOnly, Category = "Firing")

Hope you could mention this in the course, as all the crashes were getting quite annoying :slight_smile:

edit: added the fact that the first way still compiles, but makes the editor crash

4 Likes

Thank you for this Carson, I’ll include in the upcoming refactoring lecture.

This isn’t technically right, both are the right way, the quotes are for adding unusual text i.e. “Firing!@player!!!”, crashing without quotes would be a bug, which unreal didn’t used to do.

1 Like

@CoCopia Yeah, I know it’s a bug :stuck_out_tongue: , I guess I should’ve phrased it differently.

Privacy & Terms