Best practice for calling events from another class?

So working on a game that is basically an RTS game. I have a master class that I want to handle the creation of units.

I’ve made a custom event that wants input of things like unit type, spawn location, rotation, etc. I’m wondering the best way to call that event from other blueprints? I will want multiple blueprints to be able to call this function, like structures, actors with trigger boxes, events, etc. I think what I need to do is make this class public somehow? Similar to how you can call GetPlayerController and get the camera from any other bp, I want to be able to call my ‘global’ UnitCreator from anywhere

Thanks!

If your unit creator is an actor in the level you can either tag it and use get actors by tag or just use get actors by class if its going to be the only actor in the level of that class. From there you should be able to access any public variables on it and any events and functions it has.

Lots of ways to accomplish this.
What you want is often called a “global singleton”.

One approach is to have the GameMode or GameInstance create and hold a reference to it.

The simply use GetGameMode and grab the refrence directly.