Okay I see what you’re saying. With a loop that gives up eventually. If I have to maintain a loop, I’ll make sure it has a timeout.
This can get out of control rather fast.. one of your goals as a Dev is to try and minimize these References in order to use less Memory
Right I agree and that’s why I posted here, because I can see it going out of control. But I guess I’m still unsure of exactly how to minimize references. Because it seems like you literally cannot get rid of them, right? Because there will be times when In need to access stuff. Here were some of my examples i wrote in my OP above, but I probably have more
Not sure exactly what you may be trying to do but there’s usually a better way Than Hard Referencing everything and Linking/Chaining it all together
For example: from the BP_GameState, I need to access my BP_PlayerController so I stored a variable reference. And from the GameMode I need to access BP_GameState, so i stored a variable reference. From my BP_PlayerPawn I needed to access BP_PlayerController, so I stored a variable reference.
So what is the better way than hard referencing everything and linking it all together? Maybe I’m just not seeing something obvious.
- Should I not need my BP_GameState to access my BP_PlayerController?
- Should I not need my GameMode to access my BP_GameState? I don’t see a way around this hard reference unless I just call the basic getGameState.CastToBPGameState every single time. Are you saying that is better than storing a reference variable?
- Should I not need my BP_PlayerPawn to access my BP_PlayerController?