O'Reilly logo

Unreal Engine Game Development Cookbook by John P. Doran

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Saving or loading games and keyboard input with C++

As games get more and more complex and longer and longer, players will often need to play a game within multiple sessions. However, by default, players will need to start over from scratch. In this recipe, we will be going over how to save a variable and load it at runtime.

Getting ready

Before we start working on this, we need to have a project created and set up. Follow the Setting up your development environment recipe all the way to completion.

How to do it…

To give you an idea of how it works, let's do a simple example of saving a player's position and rotation, which we can return to using keyboard input:

  1. Navigate to File | New C++ Class, and you should see the Choose Parent Class window pop ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required