Download

Communicate with blueprints that are not in level?

This site documents how to communicate with blueprints, like using specific instances of a blueprint (reference+casting), interfaces, events etc.

All of these blueprints seem to be existing in the world in some way, either through player controller, placement in level or some other specific reference (game mode, hud etc.) that uses the blueprint’s class. So you can get and execute the containing functions by casting the instance after “get player controller” etc.

My question is; Does all blueprints that are executed have to be spawned in the level in order to be used? Does it need a specific instance of it, even if the blueprint (existing as function) simply takes one input value and outputs another without changing anything in the level? Like for example if a HUD-blueprint (exists though HUD-blueprint/setting) wants to call Ability1 (does not exist in level) when the user presses a button; do you need to spawn the Ability1-blueprint first? does that mean that every blueprint code you have executed will also exist in the levels as actors (ability1, ability2, etc.)? should there be some kind of cleanup for this?

If not, then how should the communication be made?

You should use a function library for this if it takes an input and processes it. If it’s using any specific reference that you don’t pass in though, you’ll need the actor in world.

Another way, if you don’t need a function call, is to use a Data Table.