Key event doens't trigger custom the first time in sublevel

Hello,

I’m using keys to make sublevels visible and trigger a custom event that launches the sequence of that sublevel.Strangely I need to press the key twice most of the time for the sequence to actually trigger. While running I can see that the first time, the event is not going to the sublevel blueprint. I press again and everything is as it should.

I’ve tried triggering twice, with a delay, inverse the order, nothing seems to work.

The levels are set to always loaded.

Any ideas?

Thanks!

Isjtar

Do you use the J key in any other blueprint? Keys are consumed as default. Put a print string directly after it, to see if it’s the key that fails or the execution flow further down the line.

I don’t. Also I just replaced it with another event (MIDI), same problem.

So if you just mash the key, does it print inconsistently?

I don’t. Also I just replaced it with
another event (MIDI), same problem.

You replaced a key with an event - so how are you triggering that event now?

Yes if I mash it, everything it’s good, in the persistent BP. It’s only in the sublevel BP that things don’t happen like they should.

If I put the key in the sublevel BP it prints properly as well.

The MIDI event is triggered by a MIDI controller, through OnMIDIEvent.

What’s up with the Remote Event - I’m not quite familiar with this. How does it work?

You give an event a name and you can catch it with the same name in another BP.

Is this from a plugin? Or something you exposed to BPs? Nvm, found it. Never used it before…

So essentially, this thing does not seem to do its job? You can clearly see the key event go off but it does not always deliver the event call in a sublevel?

Is that the case here?

No it’s a feature since a while, not very documented.

The level has to be visible to fire an event. As weird as it sounds. Could this be the problem here?

Yeah I’m thinking that as well. I tried before but I must have missed something. If I add a delay long enough, it works.

This is no solution though as it flashes to the player camera and only then starts the sequence…

Yeah I’m thinking that as well. I
tried before but I must have missed
something. If I add a delay long
enough, it works.

The delay you’re talking about goes between the level visibility and the event call, right. So if you delay the event long enough, it does trigger? Nasty.

Delay 0 does not cut it?

Yeah that’s where it goes. No, i need at east 0.02 and I’m willing to bet it varies depending on how heavy the content. Super nasty.

Maybe like this:

Yes, this helps, thanks!
Still get a flash but at least not an arbitrary delay time.

Maybe you can mask it with a fade away widget of sorts. Many quirks in the engine, still :expressionless:

Good luck with the rest.