Access to game state without cast every time?
I understand concept of GameState, but I feel bit annoyed that I would need to cast it to my class every time I need to read or write variable from it. I have created a macro library blueprint essentially just to wrap around logic for variables stored in the game state. But I am wondering if I can actually store MyGameState instance into some global-ish variable and have access to it from that macro library.
Main thing that is bothering me about this is the need for execution pins whenever I need to cast. Especially for just getting values out of the game state it is rather annoying and not always feasible.
asked Dec 12 '16 at 12:37 PM in Blueprint Scripting
You can convert a cast function pure cast from impure cast. This allows you to leave an execution pin, but also might not be completely safe since you're skipping the error check an impurecast provides.
See below the image:
Hope this help :)
answered Dec 12 '16 at 01:27 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here