I wonder how bad for performance it is to get a reference to all actors you need from a particular blueprint at begin play using “get all actors of class”?
Like I know that you should use “get all actors of class” as little as possible, preferably never even. But say that i just use it once on begin play in each actor blueprint I need a reference to a certain other blueprint. Would this still be considered a bad idea?
If yes, then what are the best ways to approach this?
I’m making a game in which i have a lot of interactable objects. Such as doors, light switches, generators, traps, … All of these specific types are inhereting from an “interactable” class which has a function “activate”. Now depending on which object the player is interacting with this “activate” function will do something different and specific to that particular type of object. Like a door will open and close. A light switch will activate or deactive a light and so on…
That and secondly, how would I go about passing info to the HUD. Like the HUD needs to display what type of object the player is looking at.
Now I already have all of this working. And it’s working quite well. But right now I’ve been using too many “get all actors of class” nodes and I wish to optimize my game as much as possible. So what are some possible ways to do this?