I’m only two weeks into learning Unreal, and I know there are things I definitely don’t understand fully, so please be patient.
Every time a certain object (blueprint for spawning ammo) overlaps with character, I need to store which one of these in the map has been picked up in an array. At the moment, that’s stored in the game instance (as I really can’t see how to store persistent variables after literal days of googling).
The game mode bp is doing its job, spawning 5 random ammo actors, but casting to the gameinstance every time to add to the array, then checking that the next one to spawn isn’t already in the array. So I can cast from GameMode to GameInstance no problem.
However, try to get an ammo bp to cast to GameInstance on overlap, and I’m met with “‘ReturnValue’ is already a ‘Game Instance’, you don’t need Cast To GameInstance .” on the CastTo node, and “This blueprint (self) is not a BP_GameInstance_C, therefore ’ Target ’ must have a connection.”
I know this is due to me misunderstanding how casting works, even though sometimes I can get it to work great. Can anyone help?