# SaveGame cast failed since the addition of new level, gamemode and player controller

**URL:** <https://forums.unrealengine.com/t/savegame-cast-failed-since-the-addition-of-new-level-gamemode-and-player-controller/479568>\
**Category:** Editor Scripting\
**Tags:** savegame, gamemode, cast-failed, unreal-engine, Blueprint, question\
**Created:** [February 28, 2021, 7:02pm UTC](https://forums.unrealengine.com/t/savegame-cast-failed-since-the-addition-of-new-level-gamemode-and-player-controller/479568 "2021-02-28T19:02:46Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![EDOTONY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EDOTONY](https://forums.unrealengine.com/u/EDOTONY)\
**Post date:** [February 28, 2021, 7:02pm UTC](https://forums.unrealengine.com/t/savegame-cast-failed-since-the-addition-of-new-level-gamemode-and-player-controller/479568/1 "2021-02-28T19:02:46Z")

</div>

![331155-immagine-2021-02-28-194619.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/5/3/f534582a3303726ad142fc21cb082167231bf9c3.png)

until today i was able to cast savegame to the gamemode to save the variable “record” but after adding a new level and to use as entry screen (with its gamemode and player controller) the cast started failing, i have no idea what could cause that as im an absolute beginner but even after trying to set up the previous blueprints the cast failed anyway. I also tried to delete the savegame BP and recreate it thinking that it might have been a bug but when doing it it was the same ( bizzare thing, i couldn’t name it as the previous BP because an asset already had that name, weird).  
The cast now fails in every BP independently, unluckly i havent copied the previous project so i’m stuck here

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [February 28, 2021, 8:00pm UTC](https://forums.unrealengine.com/t/savegame-cast-failed-since-the-addition-of-new-level-gamemode-and-player-controller/479568/2 "2021-02-28T20:00:07Z")

</div>

Cast to the game mode? Do you mean to your own save game?

I’ve had problems using short slot names. Try making the name longer.

---

<div class="post-metadata">

**Author:** ![EDOTONY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EDOTONY](https://forums.unrealengine.com/u/EDOTONY)\
**Post date:** [February 28, 2021, 8:07pm UTC](https://forums.unrealengine.com/t/savegame-cast-failed-since-the-addition-of-new-level-gamemode-and-player-controller/479568/3 "2021-02-28T20:07:59Z")

</div>

sorry, cast to savegame in the gamemode blueprint, even with longer slot name i have this problem.  
It would be ideal to have a list of possible general causes why it fails the cast but i haven’t found one

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [February 28, 2021, 8:33pm UTC](https://forums.unrealengine.com/t/savegame-cast-failed-since-the-addition-of-new-level-gamemode-and-player-controller/479568/4 "2021-02-28T20:33:25Z")

</div>

The main cause for a cast failing is two things:

1. The reference is null

2. The object is not the right type

Do you have a save game under ‘1’. Have you looked in the folder?

( project name / saved / savegames )

---

<div class="post-metadata">

**Author:** ![EDOTONY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EDOTONY](https://forums.unrealengine.com/u/EDOTONY)\
**Post date:** [February 28, 2021, 8:52pm UTC](https://forums.unrealengine.com/t/savegame-cast-failed-since-the-addition-of-new-level-gamemode-and-player-controller/479568/5 "2021-02-28T20:52:25Z")

</div>

I have the save file, what do you mean with 2) The object is not the right type? i don’t think i have changed it

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [February 28, 2021, 8:58pm UTC](https://forums.unrealengine.com/t/savegame-cast-failed-since-the-addition-of-new-level-gamemode-and-player-controller/479568/6 "2021-02-28T20:58:09Z")

</div>

The only thing it can mean here is that when you saved ‘1’, it wasn’t of type SaveGame\_G.

( it’s probably something to do with the weirdness with your save game, it might have the same name, but it’s not actually the same thing… )

---

<div class="post-metadata">

**Author:** ![EDOTONY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EDOTONY](https://forums.unrealengine.com/u/EDOTONY)\
**Post date:** [February 28, 2021, 9:12pm UTC](https://forums.unrealengine.com/t/savegame-cast-failed-since-the-addition-of-new-level-gamemode-and-player-controller/479568/7 "2021-02-28T21:12:00Z")

</div>

Ok, I’ve figured it out, thank you. basically yes the save file was from the previous SaveGame BP, creating a new save game to slot made it. I still don’t understand why it didn’t work with the previous savegame but it doesn’t matter.  
Thank you again

---

<div class="post-metadata">

**Author:** ![EDOTONY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EDOTONY](https://forums.unrealengine.com/u/EDOTONY)\
**Post date:** [February 28, 2021, 10:41pm UTC](https://forums.unrealengine.com/t/savegame-cast-failed-since-the-addition-of-new-level-gamemode-and-player-controller/479568/8 "2021-02-28T22:41:52Z")

</div>

the problem comes again when i pack the project, might that be because i have a sav file somewhere in my pc that stops the cast from working? (i’ve already exported the project a few times so maybe that’s it)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [February 28, 2021, 10:46pm UTC](https://forums.unrealengine.com/t/savegame-cast-failed-since-the-addition-of-new-level-gamemode-and-player-controller/479568/9 "2021-02-28T22:46:52Z")

</div>

Could be. The save game location is different for a packaged game ( distribution ). Then it’s

C:\Users\Username\AppData\Local\ProjectName\Saved\SaveGames

---

<div class="post-metadata">

**Author:** ![EDOTONY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EDOTONY](https://forums.unrealengine.com/u/EDOTONY)\
**Post date:** [February 28, 2021, 10:53pm UTC](https://forums.unrealengine.com/t/savegame-cast-failed-since-the-addition-of-new-level-gamemode-and-player-controller/479568/10 "2021-02-28T22:53:09Z")

</div>

i solved it by packing the project with a BP that created a slot with the same name as the first thing, then run the game with that BP and re-exported the original project with the sav file changed
