How to implement factory pattern in BP?

How can I create a blueprint that can be accesed from anywhere and is able to spawn actors?

Hey there,

(in Singleplayer)
i guess i would create a BP_Factory with a function with an Enum Input which then spawns the actors you want (based on the input Enum) and create a Reference in the GameMode. If i would like to create some specific Enemy, i would ask the GameMode to get the Factory Ref and call the spawn Enemy function on it.

I guess this might be a valid form of creating a Factory, since the GameMode is accessible by many BPs and the creational Code for the Enemy Actors is inside the Factory Actor.

Hope this helps a bit :slight_smile:

Cheers
Rob