How do I call a function in a level blueprint from another blueprint (in order to obtain an array of multiplayer spawn points in different levels)?

So I have this function in the level blueprint. I’m using it in order to get a list of target points which would change from level to level. The list returned would act as a list of spawn points. As far as I know, I cannot access the targetPoint instances directly from my character blueprint (which makes sense).


But I can’t get a reference to the level blueprint (in order to call the GetSpawns function).


How do you access the level class? Or at least what is the intended way to make multiplayer spawn points across different maps? The tutorial only explains the method for a single single-player spawn point.

Theres currently no way to do it via blueprint, most likely because you cant cast to level blueprint extended class (based from ALevelScriptActor class) made by level, so its kind of useless. You can do more via C++ by extending ALevelScriptActor and set it as default level blueprint class, then you can makes some calls to it easily and even expose it to blueprint. Theres easier solution thru, insted of getting arrays from level blueprint make level blueprint sent them to other class.

Also you aure you want this in level scripting? You could make GameMode class search for spawn points, or make spawn points raport themselfs to it on BeginPlay, team data can be set as varable and arrays could be sorted based on it. This way you dont need to copy paste this on every level

Thanks for the answer. What function do you use to make the GameMode class search for spawn points? The only function I found was FindPlayerStart, which requires a player controller as an input, while I’m trying to assign a controller/character to a spawn point in the first place.

GetAllActorsOfClass with the PlayerStart class should work from anywhere i think.

Or make PlayerStart inform GameMode that it exists. FindPlayerStart if for default respawn system of engine