Quick Dev Tip #3 UE4 - Blueprints Quick Variables

This trick with variables is only a small one but it’s the kind of tip that’s going to save you a bunch of time over time as its something you will be doing quite often.

Normally to get and set a variable you would grab the one you want from the variable list on the left-hand side of your blueprint. Dragging it out and letting go on the main canvas would bring up a little menu which you can get or set from.

 

However there are keyboard shortcuts which you can use to speed up this process, allowing you skip the picking in the menu step:

Holding Ctrl when you grab the variable and unclick on the canvas will instant create a Get variable

Holding Alt when you grab the variable and unclick on the canvas will instant create a Set variable

 

Another quick tip, while we are at it, is that you can quickly replace variables. Instead of having to drag in another Var, change the pins, delete the old one and re-align the new one, you can simply drag directly on top of the variable you want to replace.

 

However, If you try to replace a variable that is being used and is of a different type you can run into problems though. In the below example I’m trying to replace a String Var type with a Text Var type when unreal is expecting it to be a String type for the print input.

QDT03_Blog05_QuickChangeVarProblem01.JPG
 

However, I do this on purpose sometimes. Although it is showing an error currently, you can fix this simply by dragging the text out pin into the string and it will connect again automatically creating a conversion node (This will only work if the node can be converted though). I like to do this because the node stays in the same place and means that you don’t have to move stuff around.

QDT03_Blog06_QuickChangeVarFixProblem01.JPG

If you want more tips and tricks make sure to give me a follow 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/