GameState Casting Issue
I was told to try and use GameState for this goal I am trying to accomplish which is to stop a pick up counter from resetting when the player dies. The goal of this game is to pick up pants as a car (don't judge my game here LMAO). For some reason the pants pick up counter resets to 0 upon death.
I tried to use GameState (Learned most of has to do with Mulitplayer stuff) but I can figure out why I cannot cast a variable from Game State that has been stored in the GameState itself. (Yes I did go to the world settings and enable this game state to be used) How do I fix this problem?
When I try to connect the "As Game State" to the "Target (self)" it says that it is not compatible. I do not know why this is happening. I tried to restart the engine to see if that fixed it, but it did not.
This issue is killing me. I really cannot solve this and I feel so silly I cannot do this correctly.
asked Nov 18 '18 at 12:16 AM in Blueprint Scripting
Answer is in the comments
answered Nov 18 '18 at 04:03 AM
Okay, have you set the int 'PantsUpCounter' in the game state? Also, regarding the image you supplied us with, the target for 'PantsUpCounter' would be applicable with the 'As Game State' cast to node.
Also, create your own 'BP_GameState' and make sure that the Game Override for your map is set to include 'BP_GameState' as your Game State. When you go to cast to this object, you will search for 'BP_GameState'. You will not cast to the default 'GameState' unless you have set the variable there.
Follow this question
Once you sign in you will be able to subscribe for any updates here