Download

Is it possible to Play a Sequence outside Level Blueprint? And cast to the LB?

Hi all!
Starting on a tutorial, I’m doing some things to test my knowledge and uderstanding of blueprints functionality.
Now, since I’m trying to build up some sort of quicktime event system for training purposes, I’m trying to set up the version of qte where you press the button that appears on screen for multiple times. And maybe a bar fills up, or depletes or something.
Since I can’t cast to Level Blueprint to setup the binding on the progressbar (and if I can, i don’t know how to, not even if there’s some sort of workaround) I was wondering if it’s possible to move my network based on sequences (and event tracks inside) anywhere else…so the main question is: is it possible to play level sequences outside the Level Blueprint?
Because if it’s possible I’ll move the network, but if it’s not i don’t really know what to do to go further in this sort of excercise.
The second question is about the fact that it’s not possible to cast to Level Blueprint, so how can I gain access to a variable stored there?
In this case I would try to set the binding that makes the progressbar fillup or deplete, but generally I think it could be useful to know how to handle those kind of things.

1 Like

Afaik you can access everything from the level BP but you can never access anything in the level BP from another BP (Doh!). If i have some “global” stuff i usually put it in the Game Mode BP since you can cast to that from pretty much everywhere.

Hm…ok i’ll take note of that because it will be surely useful, all over the internet i’m noticing people that advise to not put too much stuff in the level blueprint for reason i don’t know really, so i’ll think about using things like Game State or Game mode instead.
On the other side, the problem is that i can’t reference anything in the persistent level if i’m not using the Level Blueprint, so i can’t eventually trigger a Sequence using an overlap on a trigger volume, but i might be wrong (hopefully) and there a way instead…

Why not to put too much stuff into level blueprint? Because if you have more than one level in game, guess what you need to code it all again, and again and again.
Second reason is that you cannot get reference to level blueprint from outside, so it is kind of black box to everything else.

How to work with level blueprint? You make event dispatcher in GameMode blueprint. Then in level blueprint on begin play you hook that dispatcher. And trigger it from game mode to let level blueprint know that something happened and you want reaction to it. Usually GameMode should be activated before level blueprint, but i think it is not guaranteed. So with all dispatcher hooks, you really should do hooking in event tick. First you find reference to blueprint that has distpatcher, then you check if its null, and if it is correct type. then you hook to dispatcher, and turn off gate that was hooking whole thingn, so it does not hook endlessly.

And as to your question:
Create custom actor blueprint, put all code in there, make it communicate with game mode blueprint, and then make level blueprint listen to game mode dispatcher. This way if you want same (or similar) quicktime event in another level all you do is place that actor, and copy code to hook dispatcher.