# \[4.8.1\] Crash when destroying pawn and unloading streaming level instance at same time

**URL:** <https://forums.unrealengine.com/t/4-8-1-crash-when-destroying-pawn-and-unloading-streaming-level-instance-at-same-time/322907>\
**Category:** World Creation\
**Tags:** Destroy, Level-Streaming, unreal-engine, crash, Blueprint, question\
**Created:** [June 24, 2015, 6:39pm UTC](https://forums.unrealengine.com/t/4-8-1-crash-when-destroying-pawn-and-unloading-streaming-level-instance-at-same-time/322907 "2015-06-24T18:39:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrcrocker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mrcrocker](https://forums.unrealengine.com/u/mrcrocker)\
**Post date:** [June 24, 2015, 6:39pm UTC](https://forums.unrealengine.com/t/4-8-1-crash-when-destroying-pawn-and-unloading-streaming-level-instance-at-same-time/322907/1 "2015-06-24T18:39:09Z")

</div>

Hell there,

I think I’ve stumbled onto an unusual bug. I have a dungeon generator that uses level streaming to put together pre-made chunks. At end of dungeon I issue a command to set all level streaming instances I’ve made to unload and destroy current player pawn.

Both these commands work fine separately but if I ask it to do both (no matter what order or with a delay between them) editor locks up and unreal engine crashes out. I don’t know how easy it is to replicate since project has grown quite large.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_33800a51](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_33800a51](https://forums.unrealengine.com/u/anonymous_user_33800a51)\
**Post date:** [June 24, 2015, 7:04pm UTC](https://forums.unrealengine.com/t/4-8-1-crash-when-destroying-pawn-and-unloading-streaming-level-instance-at-same-time/322907/2 "2015-06-24T19:04:28Z")

</div>

Hi

Please and attach log from your project after this crash occurs. You can find this in your project’s Saved\Logs folder. Thanks!

---

<div class="post-metadata">

**Author:** ![mrcrocker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mrcrocker](https://forums.unrealengine.com/u/mrcrocker)\
**Post date:** [June 24, 2015, 7:16pm UTC](https://forums.unrealengine.com/t/4-8-1-crash-when-destroying-pawn-and-unloading-streaming-level-instance-at-same-time/322907/3 "2015-06-24T19:16:49Z")

</div>

Here you go

Edit:Forgot this . of folder

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_33800a51](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_33800a51](https://forums.unrealengine.com/u/anonymous_user_33800a51)\
**Post date:** [June 24, 2015, 8:13pm UTC](https://forums.unrealengine.com/t/4-8-1-crash-when-destroying-pawn-and-unloading-streaming-level-instance-at-same-time/322907/4 "2015-06-24T20:13:39Z")

</div>

It appears to be an accessed none error involving ProjectLevelGameMode, in Minimap Trigger Update. My guess is you’re trying to access information that no longer exists from either level instance or pawn after other is destroyed. If you put a breakpoint in your Blueprint where you unload level instances and player pawn, you can probably pinpoint exactly where problem is occurring.

I can’t really see what’s causing this in particular, however, without seeing project. If you’d like to upload it somewhere and give me a download link, I can take a look. You can do so privately via PM on forums, if you’d prefer:

Thanks!

---

<div class="post-metadata">

**Author:** ![mrcrocker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mrcrocker](https://forums.unrealengine.com/u/mrcrocker)\
**Post date:** [June 24, 2015, 8:56pm UTC](https://forums.unrealengine.com/t/4-8-1-crash-when-destroying-pawn-and-unloading-streaming-level-instance-at-same-time/322907/5 "2015-06-24T20:56:10Z")

</div>

thanks for having a look I just had a check too but that minimap trigger update error has been present for a long time and still occurs even if I remove logic that crashes game so I don’t think it is to blame. I’ll upload project and send you a link and some information on how to replicate results.

---

<div class="post-metadata">

**Author:** ![mrcrocker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mrcrocker](https://forums.unrealengine.com/u/mrcrocker)\
**Post date:** [June 25, 2015, 12:54pm UTC](https://forums.unrealengine.com/t/4-8-1-crash-when-destroying-pawn-and-unloading-streaming-level-instance-at-same-time/322907/6 "2015-06-25T12:54:44Z")

</div>

Just to make sure I went ahead and fixed minimap trigger update issue but I still get crash when unloading levels and destroying player pawn.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_33800a51](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_33800a51](https://forums.unrealengine.com/u/anonymous_user_33800a51)\
**Post date:** [June 25, 2015, 8:54pm UTC](https://forums.unrealengine.com/t/4-8-1-crash-when-destroying-pawn-and-unloading-streaming-level-instance-at-same-time/322907/7 "2015-06-25T20:54:26Z")

</div>

Hey

Thanks for project! I see same crash occurring, and I’ve entered a bug report for crash (UE-17740). I’m not certain what developers will be able to do with it, however, because I suspect it’s a garbage collection issue that’s tied to your order of operations; it’s likely something is being garbage collected at just right moment for pointers to get all screwy, and it’s making things explode.

Your suggested solution of unpossessing pawn and putting a delay in before destroying pawn is not far from what you’ll need to do. A potentially safer method is to do a check inside your SpawnPlayer event to see if previous pawn is null, and if it isn’t, destroy that actor first. In TouchedFinish event, set previous player variable to Current Player value, set its CharacterMovement \> Gravity Scale to 0.0 (so it doesn’t fall below killz while you’re waiting to load up level), and then use Set Actor Hidden In Game on Current Player. This lets your pawn survive, hidden, while rest of your next level is set up, then it’s destroyed right before next pawn is spawned.

Anyway, hope that workaround helps. I’ll let you know when I see any updates on bug report. Thanks!

---

<div class="post-metadata">

**Author:** ![mrcrocker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mrcrocker](https://forums.unrealengine.com/u/mrcrocker)\
**Post date:** [June 25, 2015, 9:33pm UTC](https://forums.unrealengine.com/t/4-8-1-crash-when-destroying-pawn-and-unloading-streaming-level-instance-at-same-time/322907/8 "2015-06-25T21:33:09Z")

</div>

Thanks for your input it’s good to know It’s not just me being screwy in some way! I’ll take your suggestions on board and get a more functional work around in place.

Thanks a bunch!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_33800a51](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_33800a51](https://forums.unrealengine.com/u/anonymous_user_33800a51)\
**Post date:** [July 1, 2015, 7:26pm UTC](https://forums.unrealengine.com/t/4-8-1-crash-when-destroying-pawn-and-unloading-streaming-level-instance-at-same-time/322907/9 "2015-07-01T19:26:53Z")

</div>

Hey, just wanted to let you know that engineers have fixed whatever was causing crash with your setup, and this should no longer happen once 4.9 is released. Until then, you’ll need to stick with workaround you’ve implemented. Thanks again!

---

<div class="post-metadata">

**Author:** ![mrcrocker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mrcrocker](https://forums.unrealengine.com/u/mrcrocker)\
**Post date:** [July 1, 2015, 8:38pm UTC](https://forums.unrealengine.com/t/4-8-1-crash-when-destroying-pawn-and-unloading-streaming-level-instance-at-same-time/322907/10 "2015-07-01T20:38:58Z")

</div>

That’s great new, thanks again for your help!
