Call event from level blueprint

Hello everyone !!

In my level blueprint i created a custom event that enables collision for some trigger boxes. Basically when the player collects enough spheres in the level, the triggers will be activated. The sphere count and logic is on another blueprint, but i need a reference to the level blueprint so that the event can actually be launched.

How could i do so ?

(Sorry if my description is not very clear, english is not my native language.)

Thank you !

Hello ArkasiaConcept!

From what I understand about level blueprints, their events cannot be called normally from other blueprints like the player controller. Do not worry, there are many ways we can probably achieve the same functionality that you seek. I have made a small example to help you.

Firstly, in your level blueprint you need to make a reference to the trigger boxes available to another blueprint. You should try to make this the blueprint you want to call the event from. I am using a Player Controller for for this example.

On my player controller I have an array variable called trigger boxes where I will be storing the references, so I set up the references on the level blueprint’s Begin Play event.

Next I make a function that I can call in my Player Controller, I name it “Enable Trigger Boxes”.

In this function I loop through all of the trigger boxes and enable their collision. I am not familiar with the possible redundancy between Actor Enable Collision and Set Collision Enabled, so I did both. I recommend you experiment and find what works best for your case.

Finally, in the place you desired to call your level blueprint event, you can call this function instead. I hope this helps!

-Spiris

PS: Your English is very good, keep up the good work!

Thank you VERY much for your detailed anwer !! That helps a lot !

I actually found my way through using some event dispatcher and custom events \o/

But again learning on his own is sometime hard, feeling a responsive and helpful community is priceless !!

Thank you !