I’m trying to make a simple level where when the boss dies it displays a ‘you win’ screen but I can’t seem to get it to work. The boss is just a simple pawn and I can make him be destroyed when he dies but I can’t seem to get the screen to play. I’m making the blueprint in the level blueprint so I don’t know if that helps, thanks.
You can use a 3D Widget to display a “win screen” with buttons to return to main menu for example.
You juste have to spawn it in front of the player.
If you haven’t done any UI work yet, I suggest you start by checking out this page in the docs
Once you’ve figured out how to do this. I would look into creating a custom event that occurs when the boss is defeated.
This event should fire off the functionality you created to add a widget to the viewport.
Ok I can display the widget I just need it to know when to display it.
Yeah you can just fire an event to spawn the widget when the boss HP are equal to 0 or when you start a “die event”.
Don’t forget to mark as resolve if you’ve figured out.
For the love of the epic gods, please please don’t make that functionality in the Level blueprint. Then it is bound to that level and you’d have to re-create it when ever you decide to add the same thing to another level. You can add this functionality to the Playercontroller(PC) or the GameMode(GM).
Simply want you want to do is Call an event on the GM/PC that is called when the Boss dies that spawns the UI and adds it to the viewport.
So when the Boss has been instructed to “die” you get the GM or PC, cast it to your specific GM or PC you’ve created and call a custom event you make in either one of those. Let’s call it “Endlevel”.
On the EndLevel event you do: SpawnWidget (select your widget) and do Add to Viewport.
That should do the trick, as an additional thing you can create an animation in the widget that plays on Event Construct or something to make it a bit more interesting then just having some text spawn but that is for later.