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!
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.