End game with trigger box?

I want to add a trigger box to my game where when my player reaches the trigger box, the player freezes in place, controls are disabled, and the game fades into black after 5 seconds, and takes the player back to the main menu.

I made the main menu, and the game is pretty much set, but I need to add a mechanic where the player wins the game after reaching a certain point.

I’m using Unreal Engine 4.27.2 by the way

Anyone that can help?

vignette

3 Likes

Thank you so much ClockworkOcean for the blueprint! It worked!.. Sort of.

Your blueprint and video shows the character stopping and the screen fading, then the game starts again.

Since I had to make a few tweaks since my game is different than yours, mine immediately goes to the main menu screen

Anything I could add to make the screen fade instead?

That’s the GIF looping …

You need to put the level load on the Finished pin

( So did I. Sorry, my mistake :slight_smile: )

Is this right?

If it is, I tested it out and it only freezes my character in place for a few seconds, doesn’t fade, my character rotation isn’t disabled and then it takes me to the main menu.

You still need the update pin

:slight_smile:

I added the Update node to the Set Target node. I still go the same error, I then added the 2nd Set Target node to the Open Level By Name node.

and it took my to the main menu but it didn’t first start with freezing the rotation of my character, and it didn’t fade, it just instantly took me back to the main menu.

On the Timeline string, for the New Track 0, does that actually have to be a Float Track, a Vector, an Event, or Color track?

Thanks for your continued help by the way. :slightly_smiling_face:

Can you how the code is now? :slight_smile:

Sure! This is the code, as well as the outcome when I start the game

The update pin connects ONLY to the setting node. The Finished pin connects ONLY to the load level node :slight_smile:

Like this? If yes, then i tried it and it freezes my character in place, but the character rotations is still on and the screen doesn’t fade to black, it just skips right back to the main menu

Is that code on overlap actually running? Is the cast working? Can you put a print string in to check?

I notice you’re also blending to another camera. Maybe leave that bit out for now…

The overlap for the trigger box is working, when I run into or walk into it, with the different string I had previous, It would instantly take me back to the main menu. This is working sort of.

When I walk into the box I freeze in place, except my ability to look around, the screen doesn’t fade into black after 5 seconds, instead it just takes me to the main menu lobby after 5 seconds.

Did you get rid of that camera blend for now? I mean, it was fading to black before, what happened? :smiley:

You mean for the attack animation? That was for a different problem, and the fading into the game over screen was a menu i created. But the trigger box BP is just a command to take me back to the main menu.

But i’m just tryna see if theres a way i could add a 5 second delay/fade into the main menu screen.

But if not, then in all honestly i would settle for the bp i have bow where it instantly takes me to the main menu without delay/fade

Ok, I see your problem

Your time line is 5 seconds long, but you’re reached 1 at .5 seconds.

Hey again.

I saw your messages but couldn’t make changes to my game because I was away from my computer all day.

I’m going to take what you told me and try to fix it tomorrow. (Hopefully it works)

But would you be able to give me specific instructions on what to fix? I saw your previous post, and it seems i need to fix what was in the float track in the timeline command in my blueprints.

Just want to make sure :slight_smile:

In that pic, you can see that your timeline reached 1 in .4 seconds. If you click the second point, it has the coordinates ( .4, 1 ). So when you walk into the box, everything will go black in .4 of a second :slight_smile:

If you want it to take 5 seconds, the second point needs to be at ( 5, 1 ).

I just fixed the numbers on the float track of the timeline command. But it still didn’t work.

Here’s what I got:



I made a trigger box BP, this is the code

Here’s the effect

vignette

That’s all I can tell you. Try it in an empty level, without everything else…