Hi all.
I wished to ask for some clarification and couldnt really find an answer on my own so apoligies if this has been asked before.
While I understand how both casts and interfaces work functionally wise and how to use them, I feel like I maybe have confused myself with the memory side of what they actually do. I previously saw interfaces as a way to avoid hard references, which for the most part has actually helped me avoid issues and improve performance on a project. (I try my best to use vague references such as AActor or UUserWidget for interface functionality and avoid direct references such as AMyActor or MyUserInterface)
However, I was recently told that interfaces are pointless to use on something that is already / constantly loaded into memory such as the game manager or player character and that it is fine to cast directly between these already loaded ones as the memory is already allocated for use. (as previously I was just spamming get player character or get gamemode to trigger interfaces easily)
Is this true for the most part, have I been using over using interfaces or using them in the wrong way? Is it fine to cast between already loaded systems without causing problems with hard references ?
I am still fairly new to memory management and I am trying to learn the best way to keep usage low as possible.