How to stop UE4 crash after adding UPROPERTY


#1

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


#2

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


#3

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.


#4

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