Hi!
I’ve currently hit a wall with a feature I’m trying to implement.
I added an NPC Spawn Trigger that gets stuck whenever I switch scenes. I wanted to use the ActionList: Check running Action as a pre-scene switch check — to detect if any instance of this ActionList is running and stop the issue from occurring — but it doesn’t seem to work.
The most obvious fix would be to disable scene switching in another way, but that would require a lot of extra work and might not be possible due to multiple instances running at once.
I’ve attached a link to my setup. It’s currently getting stuck on Wait until finish or any other type of Wait action.
Would a Custom Action be possible that lets me perform this check before scene switching?
My plan is to create an event (Scene → Change → Before) that listens for any instance of this ActionList and waits until it has finished before allowing the scene switch.
Thank you in advance!
https://drive.google.com/file/d/18vYea0l47FRWJeV8r5DF8Bqim-SlTzI_/view?usp=sharing
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
If you use ActionList: Check running to check a specific ActionList asset file, then it will return "true" if any instance of that asset is currently running.
What's the specific issue you're having in running this Action?
You can't delay a scene-change once the Scene: Switch Action has been called, but you could have a custom Action that goes before it, that just waits until its own ActionList is the only gameplay-blocking list that's currently running.
Hi Chris,
Thanks for replying so quickly. The issue is that I have this specific mechanic where you trigger these spawn points, and while they do, this lengthy animation runs in the background (you can see it highlighted in green in the image). The problem is, if I switch scenes while any “wait” action is running and then go back to that scene, the animation will continue until it completes, but then it gets stuck afterwards and never runs the rest of the ActionList.
I’ve tested it, and it seems to occur with any type of “wait.” It doesn’t matter if it’s playing a sound with a wait check on it, or if you add an engine wait — it freezes, and the ActionList won’t reset or continue. I need a way to always ensure that scene switching is delayed until this ActionList is finished.
That's what I was getting at with my last paragraph above. Would an Action like that be useful?
I think it would. It’s probably an edge use case, but I can see this being extremely helpful. If you’d be so kind as to point me toward the method I can use, I’ll try adding the custom Action myself. I’ve gotten a bit more comfortable with supplementing the engine with custom scripts.
Sure - you can get information about what ActionLists are currently running within ActionListManager.
To determine if the game is currently blocked due to ActionLists (save for an optional Action to ignore):
Thank you! I'll get on it right away!
I just noticed you suggested "IsGameplayBlocked ". I should note that the ActionList in question does not block gameplay it just freezes on that wait time and doesn't reset at all, after scene switching. Does the method you suggested still apply?
Hi. Please disregard this thread. I’ve tried several approaches, and I think the simplest and most reliable solution is to add a variable check for spawning during every scene switch.
The variable is set to true during the spawn process and turned false right after the Wait action that was causing the ActionList freeze.
I might later automate this through an Event, but for now I don’t think there’s a built-in option for disabling scene switching while a variable is active.
Thank you for the help, and sorry for wasting your time!