Learning Unreal 5: How to Create Custom Console Commands in Blueprints

Most people that have played PC games for any length of time are familiar with console commands – especially if you’ve played games like Bethesda’s Elder Scrolls games. For the unawares, typically, when in game you hit the tilde (~) key to bring up an input window that lets you type. Here you can type various commands – some engine specific, some game specific. Often times, these are used to help in development and testing to change values on the fly, trigger certain quests without doing them normally, make your character invulnerable – and more.

So, to help with the development of my game I wanted to see how custom console commands are set up in Unreal 5 using Blueprints.

Caveats

  • Level Blueprints Only. When working with blueprints, you can only create custom console commands in the level blueprint. If you want to create console commands in other locations, you’ll need to dive into C++. Mike Stevanovic has a good video for the basics on youtube.
  • Development Builds Only. Custom console commands only work in development builds – if you package your project for shipping, the commands won’t work there. If you want to implement cheats, you’ll need to implement them differently than discussed here.

Creating Custom Console Commands

Go to your level blueprint

  1. Open the level
  2. Click on the flow chart icon under the menu
  3. Click open level blueprint
Demonstration of where to find the Open Level Blueprint option in the Engine.

Create a custom event

For example’s sake, we’ll go ahead and create a custom event that will let us update the walking speed of the player.

  1. Right click in the event graph and search for the custom event node
  2. Name the custom event testEvent
  3. Right click on the event graph and create a Get Player Character node
  4. Drag from the Get Player Node pin and create a Character Movement node.
  5. Drag from Character Movement node and create a Set Max Walking Speed node. Set the max speed to something very high, like 1000 (default is 600).
  6. Connect the Max Walking Speed to the Custom Event node.
  7. Drag from the Max Walking Speed node and create a Print String node. Update the text to “speed updated”.
  8. Save and compile the blueprint.
Visual example of the final look of the testEvent custom console command.

(Optional) Make the walk speed variable customizable

  1. Click on the testEvent node
  2. In the details panel, click + next to input and add a variable named Speed with type of Float.
  3. Connect the new Speed pin to the input of the Set Max Walking speed node.
Visual example of the final result of the testEvent custom console command with variable speed.

Using the console command

  1. Hit play on the engine to play the game.
  2. Once launched, hit tilde (~) to open the console window
  3. Type ce testEvent or ce testEvent 1000 if you set up the variable and hit enter. The string “speed updated” should appear in the top left corner and when you move around the character max speed should be much higher.
Visual example of using the custom event in-game.