How to save score in unreal engine 5 ?

Hello,

i have in my vr-game 4 levels where the gamer has to accomplish some tasks in a specific time and in every level i want to calcutate the points from 2 Parameters (time required and number of errors made). So this calculation is the same in every level and at the end of choosen level should be displayed the points and the time.
Where and how icould i implement this calculation and save it in the system. And how can i then make sure that at the end of each level is this score board showen.
I am using bluprints for this game

You can calculate and store variables using a GameInstance. You can use Google to learn more about how to use it. Here’s a simple example:

  1. Create a GameInstance and make sure to assign it (replace the default one in Project Settings).
  2. Create a variable and define how you want to calculate the score (on the YourGameInstance).
  3. Save the score to a variable.
  4. Whenever you need it, call it using: Get Game InstanceCast To YourGameInstanceYour Point Value Variable.

Hey there @abde_habibi! Welcome to the community! Hotuan is correct in that you could use your Game Instance to hold the variables, and they will last until that play session ends. If you wish to save the variables and load them again after this play session, you’re going to want to learn about saving and loading as well.

Disclaimer: One or more of these links are unaffiliated with Epic Games. Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.

Official documentation on saving and loading:

This tutorial series by Ryan Laley actually creates a save/load system, while utilizing the game instance as well!

3 Likes

Thanks that solved my problem. Really a big help! :smiley:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.