How can I display a widget when the player character is destroyed?
Can anyone provide an image of the correct blueprint script to display a widget when the player character is destroyed using "ondestroyed?" Very new to ue4, sorry if this is obvious :/ Thanks!
asked Jun 26 '18 at 02:25 AM in Blueprint Scripting
Sure - here's a quick example I tacked on to the ThirdPersonExample project:
In the level blueprint, I've created two custom events: DestroyCharacter and Died.
DestroyCharacter just calls DestroyActor on the character, and Died constructs a widget and adds it to the viewport.
When BeginPlay is fired on the level blueprint, both of these get hooked up. Firstly, a timer is setup to call DestroyCharacter after 4 seconds (just for testing it out). Then, We bind the Died event to OnDestroyed for the Player Character.
Follow this question
Once you sign in you will be able to subscribe for any updates here