How exactly does Casting work? like let’s say I want to retrieve a few variable values from an actor, does the engine load an entirely separate copy of the actor I’m casting to to get that value from to the memory? how often and when is it really “safe” to cast? are interface calls any better?
if you will access one blueprint from another often then you can cast and store the actor in a variable so you can access later without casting all the time.
Also you can add tags to actors and before casting it you just check if has some tag to be sure the actor is what you expect to be before casting it and save a wasted cast.
Also you can use interfaces that is defining functions in the blueprints and you implement in each blueprint as you need so instead of cast the actor you just call the interface functions on it.
For example…in GameState I use to add variables and functions related to the core of the level gameplay and if I need to use in many different blueprints then I just get gamestate and promote to a variable locally in each blueprint begin play and later I just go for that variable to get the functionality.
you dont need to obssess about avoiding casts at least you deal with a lot of actors casting a lot of things on each game tick.
same avoiding ticker…a lot of things are not required to be running or checking on every tick…instead use timers. But if you use ticker in some situations is ok.