Trying to save the player state as a reference variable so I can use it later.
It is set from spawn at beginplay and a print/test confirms it saves the player state correctly.
Literally beginplay > cast from controller > get state and save as ref
If I use the cast everytime it works properly but if I attempt to use the one that is saved it will return accessed none everytime. Is there a reason I can’t save my player state? It feels stupid that I have to cast when the state isn’t changed.
Any help appreciated, thanc
Edit: Bump, still no answer and can’t find any info on the web. This seems to not just be a player stat problem as well. If I want any reference to the player or state I have to cast every. Single. Time.
Which just feels very inefficient for storing info to the state. Is there a reason I can’t just set a reference and forget about it?
I don’t understand how does a delay do anything here? And that’s basically what I’m doing, I just use casts to set the references as I have custom controller, player, state and hud.
Hmm no dice, even with a delay. I think it’s because I’m using a custom player state, when I use get player state it is the default one, not mine. And for some reason saving a reference to it also won’t work.
On Event BeginPlay in whatever actor you want to access the player state do Event BeginPlay->get player controller->get player controller-> cast to your playerstate → then drag off your player state and promote to variable