Download

[Help Needed Please] Enable Input for Trigger Box On Load Level

Hey Everyone!

Got a bit of an issue enabling input using Blueprint on a Load Level script. When my character walks into the trigger zone, it detects the collision and loads the level in the script on contact. I’m putting doors in the levels, so I want the player to be able to walk into the trigger zone, press the action key (which is the E key), and load the level specified in the script. Now I’ve tried several methods, and had really messed up results:

f1cf9ec41f2f405ac979a4692a2b59582ed3ed0d.jpeg
00db5d38b8a0b90efb6038ae77326a9aa9f9d102.jpeg

  1. Tried using trigger volumes and tying them into the level blueprint. That caused two issues: The first being that it never detected the input, and instead would detect the key press no matter where the player was standing whether they were in the trigger box or not, and THEN it would randomly choose one of the levels specified in the level blueprint and teleport them there on key press.

  2. I’ve also created a Blueprint class called Load_Level, and it’s basically a trigger box with a script tied to it that should allow input when the player is in the volume and allow them to hit the action button and go to the specified level. I’ve tried different variants of this standalone Blueprint class but nothing seems to work. When the player enters the trigger zone, it just loads level on collision instead of enabling input.

0d9dc6c72eea807f965bd928a0f359f99d3900e4.jpeg
Variation 1 (Above)


Variation 2 (Above)

I recall going into the player character blueprint and disabling the action button so that it’s only enabled when entering a trigger zone with a blueprint that enables it, but that doesn’t work either. I feel like I’m missing one little thing that’s throwing everything off. That or I’m using a bunch of commands that aren’t necessary, so I apologize if it’s more cluttered than it needs to be.

Thanks so much for your time!

I have a project deadline so I’m bumping this if anyone could share a bit of insight, thanks!

Try something like this, tested it in my own project, seems to work correctly

Thanks so much for your reply! I’m going to test this out in the morning and let you know what I came up with!

Ok so I was going to throw this script everywhere and see where it worked, but I was wondering, where did you put this blueprint? Is it in the level blueprint, its own class, or in the character blueprint?

When I did it I put it into the trigger actor, in your case it would be the shown “Load_Level” actor placed in the world using the colision box to detect overlap events

Figured it out, I used this documentation page before but something wasn’t working for me. I plan on looking into what caused the incompatibility in order to explain in case someone else has this issue, but in the meantime, here’s what I did to fix the issue, and before I continue, thanks to NDFJay for posting the screen of their blueprint because when I noticed they used a component overlap trigger, I decided to look into component collision and I realized that I needed to toggle the detection for the actual trigger box in the blueprint class.

This is the script I used, and it properly loads the level only when the player is in the trigger zone and the action key is pressed. Now I was going to do this the long way and make a separate script for each level load instead of creating a variable for the level names, but when I duplicated this blueprint class, every single level load trigger literally just kept reloading the same level. Nothing I did fixed it until I closed and reopened Unreal and now it works. I’m guessing there’s an issue with level streaming or something with simulation, but I’m going to stick with this, cook the game, and see if the levels load properly with this method. Thanks for your help and hope this reference serves anyone who finds this thread. As I hammer out the issues, I’ll update this thread or just post the whitepapers on my website when the game is complete and I’ve had time to sit down and type up the development documentation.

Sorry for the Noob question, but what nodes are these?

Unreal.PNG

5 years late my guy