# Crash after creating widget on death

**URL:** <https://forums.unrealengine.com/t/crash-after-creating-widget-on-death/450561>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [June 12, 2019, 3:14pm UTC](https://forums.unrealengine.com/t/crash-after-creating-widget-on-death/450561 "2019-06-12T15:14:10Z")\
**Posts on this page:** 10\
**Page:** 2

<div class="post-metadata">

**Author:** ![Strikeless](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Strikeless](https://forums.unrealengine.com/u/Strikeless)\
**Post date:** [June 13, 2019, 11:55pm UTC](https://forums.unrealengine.com/t/crash-after-creating-widget-on-death/450561/21 "2019-06-13T23:55:30Z")

</div>

same issue actually, created a seperate player controller and hooked it to my gamemode.  
This probably has to be a bug, even with default stuff…

---

<div class="post-metadata">

**Author:** ![Strikeless](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Strikeless](https://forums.unrealengine.com/u/Strikeless)\
**Post date:** [June 14, 2019, 11:16pm UTC](https://forums.unrealengine.com/t/crash-after-creating-widget-on-death/450561/22 "2019-06-14T23:16:34Z")

</div>

Still having this problem…

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e317d48f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e317d48f](https://forums.unrealengine.com/u/anonymous_user_e317d48f)\
**Post date:** [June 15, 2019, 7:42am UTC](https://forums.unrealengine.com/t/crash-after-creating-widget-on-death/450561/23 "2019-06-15T07:42:45Z")

</div>

Tell you what man…

I told you I’m not a c++ guy, but I’d be willing to get on discord with you next week and screen share, because honestly - this should not even be an issue whatsoever.

Destroying your character and getting a widget to pop up on screen - should be absolute cake-walk. And in blueprints, it is.

Now I’m not sure if a UE4 project can contain both c++ and blueprints combined, however I’d be willing to give you some time, because again - of all the issues you will be dealing with in your time using UE4, this should not be one of them.

let me know…

---

<div class="post-metadata">

**Author:** ![Strikeless](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Strikeless](https://forums.unrealengine.com/u/Strikeless)\
**Post date:** [June 17, 2019, 10:20pm UTC](https://forums.unrealengine.com/t/crash-after-creating-widget-on-death/450561/24 "2019-06-17T22:20:50Z")

</div>

Sorry for the late reply. I haven’t gotten a plus from the people I work with (I don’t own the project and it’s under an nda) so I don’t think I can quite do this.

Still having this issue to this day, really getting tired of this and on a time constraint here.

---

<div class="post-metadata">

**Author:** ![Firefly74](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Firefly74](https://forums.unrealengine.com/u/Firefly74)\
**Post date:** [June 18, 2019, 8:02am UTC](https://forums.unrealengine.com/t/crash-after-creating-widget-on-death/450561/25 "2019-06-18T08:02:49Z")

</div>

without beeing able to put hands on the project it’s going to be very hard to reproduce…  
few more thing :

- When you got it crash with vs attached, go back up in the call stack and check all local variable you can, to see if you can come up with a image name or widget name causing it. ( it may not be your widget but an other on conflicting somehow ?)
- could you put that code into a method and call it manually at runtime ( when player isn’t dead ) ? ( make it BlueprintCallable and bind it on player controller , or though cheat manager as exec if you have one setup )
- last one, make a blueprint event “OnDie” on you player, that you brodcast from here and on you bp, you spawn the widget ( should crash the same way, but who knows ? )

---

<div class="post-metadata">

**Author:** ![Strikeless](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Strikeless](https://forums.unrealengine.com/u/Strikeless)\
**Post date:** [June 20, 2019, 3:12pm UTC](https://forums.unrealengine.com/t/crash-after-creating-widget-on-death/450561/26 "2019-06-20T15:12:09Z")

</div>

Still isn’t working…

---

<div class="post-metadata">

**Author:** ![Strikeless](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Strikeless](https://forums.unrealengine.com/u/Strikeless)\
**Post date:** [July 2, 2019, 10:41pm UTC](https://forums.unrealengine.com/t/crash-after-creating-widget-on-death/450561/27 "2019-07-02T22:41:24Z")

</div>

Okay, still haven’t fixed this.

I’ve made sure the player controller exists and isn’t null, the widget exists and isn’t null.  
Whenever ‘AddToViewport’ is called it crashes.

`
if
(URespawnCPP* RespawnUserWidget = CreateWidget(controller, RespawnWidget.LoadSynchronous()))
{
```
 controller->SetInputMode(FInputModeUIOnly());

 controller->bShowMouseCursor = true;

 RespawnUserWidget->AddToViewport();

```
`

`}
`

---

<div class="post-metadata">

**Author:** ![Strikeless](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Strikeless](https://forums.unrealengine.com/u/Strikeless)\
**Post date:** [July 3, 2019, 5:51pm UTC](https://forums.unrealengine.com/t/crash-after-creating-widget-on-death/450561/28 "2019-07-03T17:51:00Z")

</div>

Still having the issue…

---

<div class="post-metadata">

**Author:** ![Firefly74](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Firefly74](https://forums.unrealengine.com/u/Firefly74)\
**Post date:** [July 4, 2019, 7:04am UTC](https://forums.unrealengine.com/t/crash-after-creating-widget-on-death/450561/29 "2019-07-04T07:04:28Z")

</div>

without beeing able to debug it make it impossible to help you 😕  
did you try to spawn the menu at a different time like i suggested ? Did it crashed too ?  
What about the blueprint way i suggested ? also crashed ?

---

<div class="post-metadata">

**Author:** ![Strikeless](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Strikeless](https://forums.unrealengine.com/u/Strikeless)\
**Post date:** [July 4, 2019, 1:08pm UTC](https://forums.unrealengine.com/t/crash-after-creating-widget-on-death/450561/30 "2019-07-04T13:08:18Z")

</div>

Yes, I tried that way before posting this question. 2-5 second delay, doesn’t matter.  
I haven’t tested the blueprint way.

[Previous page](https://forums.unrealengine.com/t/crash-after-creating-widget-on-death/450561.md?page=1)
