# Why can't I cast to PlayerState inside SaveGame Blueprint?

**URL:** <https://forums.unrealengine.com/t/why-cant-i-cast-to-playerstate-inside-savegame-blueprint/463393>\
**Category:** Editor Scripting\
**Tags:** savegame, playerstate, casting, save-game, unreal-engine, question\
**Created:** [April 6, 2020, 4:03pm UTC](https://forums.unrealengine.com/t/why-cant-i-cast-to-playerstate-inside-savegame-blueprint/463393 "2020-04-06T16:03:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![stuck\_compiling](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@stuck\_compiling](https://forums.unrealengine.com/u/stuck_compiling)\
**Post date:** [April 6, 2020, 4:03pm UTC](https://forums.unrealengine.com/t/why-cant-i-cast-to-playerstate-inside-savegame-blueprint/463393/1 "2020-04-06T16:03:18Z")

</div>

I need to read some variables from a PlayerState and I can cast into it without any issues during gameplay. If I try to cast to it in a SaveGame Blueprint, I don’t have the option to add nodes “Get Player Controller (0)” \> “Target (Player State)” which I need as input when casting to my particular PlayerState. Why is that? If there is no way to do this particular operation, what options do I have?

---

<div class="post-metadata">

**Author:** ![Blackforcedragon](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blackforcedragon/32/1010299_2.png) [@Blackforcedragon](https://forums.unrealengine.com/u/Blackforcedragon)\
**Post date:** [April 7, 2020, 11:47am UTC](https://forums.unrealengine.com/t/why-cant-i-cast-to-playerstate-inside-savegame-blueprint/463393/2 "2020-04-07T11:47:26Z")

</div>

The save Blueprint only support variables like floats and strings etc…

What are you trying to save?

---

<div class="post-metadata">

**Author:** ![stuck\_compiling](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@stuck\_compiling](https://forums.unrealengine.com/u/stuck_compiling)\
**Post date:** [April 7, 2020, 2:58pm UTC](https://forums.unrealengine.com/t/why-cant-i-cast-to-playerstate-inside-savegame-blueprint/463393/3 "2020-04-07T14:58:23Z")

</div>

My issue isn’t saving variables, it’s casting into a GameState which stores booleans ints floats etc that describe what’s happening in-game. I can cast into the GameState from the player, the controller, any actor etc, but there is no option to do so inside a SaveGame, which is my issue.

---

<div class="post-metadata">

**Author:** ![Blackforcedragon](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blackforcedragon/32/1010299_2.png) [@Blackforcedragon](https://forums.unrealengine.com/u/Blackforcedragon)\
**Post date:** [April 7, 2020, 3:21pm UTC](https://forums.unrealengine.com/t/why-cant-i-cast-to-playerstate-inside-savegame-blueprint/463393/4 "2020-04-07T15:21:44Z")

</div>

The SaveGame Blueprint can only make a “.sav” file and can’t execute codes by itself.

But you can add GameState to it, but you need a code from the player Blueprint, an Actor Blueprint or a widget.

![299251-023.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/d/4/1d4b313bcf438433c7913b09bea0173f4e4ba112.png)

Do you need help with save and load for your game?

Edit

![299252-024.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/8/1/68175c9bc33bfe3400c1adf7b19105266609dbc1.png)

---

<div class="post-metadata">

**Author:** ![stuck\_compiling](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@stuck\_compiling](https://forums.unrealengine.com/u/stuck_compiling)\
**Post date:** [May 24, 2020, 2:59pm UTC](https://forums.unrealengine.com/t/why-cant-i-cast-to-playerstate-inside-savegame-blueprint/463393/5 "2020-05-24T14:59:23Z")

</div>

I finally figured out how to use SaveGame properly. I created a SaveGame Blueprint, and added various variables I’d want to save. Instead of casting to it during gameplay and triggering Saving Events, I just use Save / Load Game nodes and cast to this for values.
