Download

UNREAL UE4 - How to trigger a Level BP event from main character, when it isn´t in the scene?

Hi, every X amount of time, my main character is going to spawn enemies at target points (no main player controller), since my game has multiple levels, i need the spawn to be triggered at the level, meaning when my character countdown its over a new spawn event its going to happen at each level (spawns wont be automatic at level begin play), my problem is how to cast my character at the level BP, because he is not in the scene, since i use “player start up” object to trigger my character in the scene, then, i canot reference him at the level BP, neither dispatchers work for that matter;

I tried to create a boolean “spawnenemies true” at my character, then at the Level BP i created a variable to reference main character object, then i got from there the boolean, and connected it to a Branch from a tick… BUT… LevelBP tick is not detecting the boolean change from true to false at Character BP… and i dont want the tick to cast to my character every second……

What can i do? I just want to trigger a LevelBP event from my character.

Hello, what about create a new blueprint, place it in the level and use it for spawn the enemy on the level when a function or a custom event is called for example?

Multiple ways to do so, but my solution would be to “cast to gamemode” in both levelBP and characterBP. Inside the gamemodeBP make an event dispatcher in it (lets name it SpawnEnemiesED).

Then from the levelBP (or characterBP, whichever you want to use the trigger), pull “call SpawnEnemiesED” from the gamemode you casted to. The Event Dispatcher will then launch, and every blueprint you want can launch their own events at that timing.