Download

Trigger boxes are not working in packaged project

I have worked for a long time on my demo level of my game and getting ready to publish to Steam early access but now after packaging my game none of the trigger boxes work.
Trigger boxes are an integral part of the level layout and design and with out the enemies spawning from the target points is a major problem and let down leaving the level dead. Has this happened to anyone else and is there a fix for this…everything works when playing in the editor…but nothing works in the packaged version Development or Shipping.

Did you turn on the “Generate Overlapping…” on the trigger box?

I have the same issue in packaged projects, but only in streaming levels!

And I made sure that Generate Overlapping Events is on in both my actor and the dynamically added trigger boxes I have.

But what I really don’t understand is why the criteria for play in editor and packaged builds are different? What’s the use of having something work in the editor and fail in a build?

Unless this is just a bug (which is always possible as engines can break between versions), check if this is user error… Is there critical setup-code that needs to run but isn’t???

One of the key reasons unexpected things can happen in builds versus editor is different startup orders that can occur in packaged versions (look for other factors too like multiplayer vs singleplayer). So watch out for coupling things too tightly and making assumptions about on BeginPlay across different actors. See here and here and here

If critical setup code requires references from other BP’s, don’t assume those other objects or actors already exist - instead test for them. You can use IsValid loop-backs to loop code back on itself on a delay to wait for all the dependent actors to be created first and in the right order. Problems could be elsewhere ofc, but this is one thing you can definitely check. As regards trigger boxes not working, what assumptions / dependencies depend on those? There will always be cause / effect or diagnostic info somewhere, you have to debug this. :wink:

1 Like

Thank you very much for the tips. I was aware of some of them, and I do similar diagnostics as well:

My problem is that I add my colliders in question (the “tiles” count in the screenshot) in my constructor… which means no amount of prints work in either packaged or the editor… so I’m actually currently at a loss on exactly to debug that.

Construction Scripts sets off alarm bells as they come with so many gotchas. Could you re-link the code off BeginPlay (at least for now to test), or where would that cause problems?

Yes, then it starts working.

I actually wanted to lift everything out to an Editor Utility Blueprint, because I’m “baking” those tile colliders anyway from the level geometry, so it doesn’t need to be runtime at all. However, another hurdle is that you apparently can’t add primitive colliders to level actors in Editor Utility Blueprints. :frowning:

But again, the variances I am encountering here is the fact that I have two areas in the packaged build, but only one is working. The one that isn’t working is in a streaming level. And regardless, the thing that stops working is in a constructor which shouldn’t be runtime anyway?

When something obvious doesn’t work you have to look at the usual suspects (the areas where Epic don’t show enough love or the areas where complexity is actually quite high). So personally I stay away from Construction-Scripts & Level-Streaming. Why? Overall, I want to get paid (just Unreal Survival-Tactics-101). So I say, if you can, stay away from areas that may burn you now or later or eventually, even if they are marketed as simply amazing. :stuck_out_tongue: