QUICK DEV TIP #57 UE4 / UE5 - BREAKPOINT ON BLUEPRINT ERROR

Here is a useful thing that I found out about the other day which can help you make a more robust game.

Did you know you can force the editor to breakpoint when it hits a blueprint error at runtime?

If you would prefer to watch the video version, check it out here

This useful setting isn’t on by default so we need to go up to Edit --> Editor Preferences to turn it on.

 

At the top of the editor preferences, if you search for Exception, you find the setting we need which is called Blueprint Break on Exceptions. This is under experimental features so just keep that in mind.

 

In the GIF below you can see how if we play the game normally, with the option turned off nothing happens. But if we turn the setting on and play the game we instantly hit a breakpoint, on something that is wrong. The cool thing about this is it takes you to the exact location and the game is technically still running so you have a chance to check some variable values.

 

In the case that I set up here it is breakpointing because it is hitting an access none on a object variable that is null. The interesting thing about this is that because blueprints have a bunch of safety stuff in, it doesn’t cause a crash unlike what would probably happen in C++. The problem with this is that, as you can imagine this means you can have entire chunks of your blueprints that wouldn’t work as expected but not be causing a crash. For example, in my setup below, any functionality that was relying on that variable would not work correctly.

 

This setting exists and seems to work in exactly the same way in the Early Access Version of Unreal 5. The main difference is with the new engines UI overhaul.

Like I said I found out about this recently and its be really good for tracking down problems which I didn’t even know existed, to help make a more sturdy game.

If you want more quick tips & tricks FOLLOW ME ON TWITTER @cbGameDev

Also, check out the parkour game I'm solo developing called Freerunners. Give it a wishlist if you like the way it looks!: https://store.steampowered.com/app/1430330/Freerunners/