# Cast to SaveGame failed

**URL:** <https://forums.unrealengine.com/t/cast-to-savegame-failed/450743>\
**Category:** Editor Scripting\
**Tags:** savegame, cast-failed, unreal-engine, question, Blueprint\
**Created:** [June 15, 2019, 7:39pm UTC](https://forums.unrealengine.com/t/cast-to-savegame-failed/450743 "2019-06-15T19:39:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ProDataDavid](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ProDataDavid](https://forums.unrealengine.com/u/ProDataDavid)\
**Post date:** [June 15, 2019, 7:39pm UTC](https://forums.unrealengine.com/t/cast-to-savegame-failed/450743/1 "2019-06-15T19:39:51Z")

</div>

Hello,  
I try to get data from a SaveGame named LevelSave. The problem, always I get a cast failed but only when I compiled for the shipping mode with an active “For Distribution” checkbox. When I compile the development mode I don’t get any errors. I can’t upload a development mode Android App so its important to use a shipping mode version but I don’t understand why this option don’t work. Do you have an idea?

 ![279916-screenshot-109.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/2/0/d206d8c7b6e25ec846daacc688d06caa1f8ca32e.png)

---

<div class="post-metadata">

**Author:** ![JmDevTx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JmDevTx](https://forums.unrealengine.com/u/JmDevTx)\
**Post date:** [June 15, 2019, 9:25pm UTC](https://forums.unrealengine.com/t/cast-to-savegame-failed/450743/2 "2019-06-15T21:25:43Z")

</div>

Does a save file exist for it to load? The save file would likely be loaded from a different location when packaged for shipping. Make sure you have created and saved a save object before trying to load one. In your image, you are creating a save object, but not saving it to your computer.

---

<div class="post-metadata">

**Author:** ![ProDataDavid](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ProDataDavid](https://forums.unrealengine.com/u/ProDataDavid)\
**Post date:** [June 16, 2019, 8:38am UTC](https://forums.unrealengine.com/t/cast-to-savegame-failed/450743/3 "2019-06-16T08:38:14Z")

</div>

Which file I have to create? I only have the savegame bluescript file but the documentation never showed that I have to create one. When you mean the Save to Slot Function, I save it to slot before

[https://docs.unrealengine.com/en-US/Gameplay/SaveGame/Blueprints/index.html](https://docs.unrealengine.com/en-US/Gameplay/SaveGame/Blueprints/index.html)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e317d48f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e317d48f](https://forums.unrealengine.com/u/anonymous_user_e317d48f)\
**Post date:** [June 16, 2019, 9:03am UTC](https://forums.unrealengine.com/t/cast-to-savegame-failed/450743/4 "2019-06-16T09:03:11Z")

</div>

In looking at this picture, I don’t see the need for this cast, as you already have a valid reference to your GameSave

The logic in this pic shows - “create save game object” Node (this outputs a reference to the GameSave)

Then “load game from slot” Node - which also outputs a valid GameSave reference

And then, Cast to GameSave ??? Why? - when you already have two other valid references to the GameSave. Unless there is another reason for the cast other than to obtain a reference

I would eliminate this cast - and just continue the execution, I got a feeling this will solve your problem

Hope this helps, let me know

---

<div class="post-metadata">

**Author:** ![ProDataDavid](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ProDataDavid](https://forums.unrealengine.com/u/ProDataDavid)\
**Post date:** [June 16, 2019, 1:35pm UTC](https://forums.unrealengine.com/t/cast-to-savegame-failed/450743/5 "2019-06-16T13:35:03Z")

</div>

I cast to it like its shown in the documentation ([https://docs.unrealengine.com/en-US/Gameplay/SaveGame/Blueprints/index.html](https://docs.unrealengine.com/en-US/Gameplay/SaveGame/Blueprints/index.html) and [https://docs.unrealengine.com/Images/Gameplay/SaveGame/Blueprints/LoadGameBP.png](https://docs.unrealengine.com/Images/Gameplay/SaveGame/Blueprints/LoadGameBP.png))

When I delete it and use the first reference it does not load.
