# UE 5.2 crashes often when compiling blueprints.

**URL:** <https://forums.unrealengine.com/t/ue-5-2-crashes-often-when-compiling-blueprints/1203416>\
**Category:** Blueprint\
**Tags:** unreal-engine, crash, question, Blueprint\
**Created:** [June 18, 2023, 8:22pm UTC](https://forums.unrealengine.com/t/ue-5-2-crashes-often-when-compiling-blueprints/1203416 "2023-06-18T20:22:05Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![SpectreKelevra](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/spectrekelevra/32/723050_2.png) [@SpectreKelevra](https://forums.unrealengine.com/u/SpectreKelevra)\
**Post date:** [June 18, 2023, 8:22pm UTC](https://forums.unrealengine.com/t/ue-5-2-crashes-often-when-compiling-blueprints/1203416/1 "2023-06-18T20:22:05Z")

</div>

**SOLUTION:**  
Do not reference self if your event might run after actor is destroyed, especially if you’re spawning a duplicate actor, it creates a dependency that breaks the engine.

* * *

I’m using UE 5.2, have been for a while on the same project, and suddenly last night it started freezing about 80 - 90% of the time I compile a blueprint.

It is not a crash with a crash screen, the engine stops responding, hogs a bunch of ram, and freezes indefinitely.

The times when compiling works, it works instantly as my code isn’t that heavy.  
When End task through the task manager and restart the engine, it **may** compile fine or may freeze again, requiring a different restart.

Does anyone have any idea why this is happening?

Screenshots of the crash:  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/2/f/32fa0e3985d59d7a6eceb6efe80d817b1867af6e.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/4/1/641de8ee4fda8910efe080dccc9bf4f8a13ed17b.png)

After a restart

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/1/c/c1c7cc5480ad6563f54d873fa39cd49ac1661131.png)  
Compiles just fine and runs instantly.

**Update** :  
No progress, crash still occurs,  
updates:

1. Deleted Build, Intermediate, and saved folders.

2. Migrated asset to a blank project.

3. Removed all constructions scripts except for the one in an unrelated BP.  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/2/6/1263e2bd18f4b00fdc49185527f238c1c7ebeff7.png)

4. Added asset to blank level.

5. Checked reference for circular dependencies:  

6. Project packaging and running works fine.

7. Created a child blueprint class of the affected blueprints, also freezes the editor on compile.

8. Tested on a different machine.

9. Made a new Blueprint with the same functionality.

10. Removed implemented interfaces and their corresponding functionality.

Still have not found a solution, the crashes continue.

---

<div class="post-metadata">

**Author:** ![SpectreKelevra](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/spectrekelevra/32/723050_2.png) [@SpectreKelevra](https://forums.unrealengine.com/u/SpectreKelevra)\
**Post date:** [June 18, 2023, 8:46pm UTC](https://forums.unrealengine.com/t/ue-5-2-crashes-often-when-compiling-blueprints/1203416/2 "2023-06-18T20:46:14Z")

</div>

| Device | |
| --- | --- |
| Processor | Intel(R) Core™ i7-10700K CPU @ 3.80GHz 3.79 GHz |
| Installed RAM | 32.0 GB (31.9 GB usable) |
| Device ID | 7F3B23EF-C33C-45D9-9949-B41FE0520240 |
| Product ID | 00330-80000-00000-AA762 |
| System type | 64-bit operating system, x64-based processor |
| Pen and touch | Pen support |

Nvidia 2080 super.

My system btw, if that’s relevant

---

<div class="post-metadata">

**Author:** ![SpectreKelevra](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/spectrekelevra/32/723050_2.png) [@SpectreKelevra](https://forums.unrealengine.com/u/SpectreKelevra)\
**Post date:** [June 25, 2023, 9:41pm UTC](https://forums.unrealengine.com/t/ue-5-2-crashes-often-when-compiling-blueprints/1203416/3 "2023-06-25T21:41:56Z")

</div>

Update, It seems to crash when compiling specific blueprints, but I don’t know what they have in common, one is an enemy parent BP (With no children yet) and 2 are projectiles.

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [June 25, 2023, 9:52pm UTC](https://forums.unrealengine.com/t/ue-5-2-crashes-often-when-compiling-blueprints/1203416/4 "2023-06-25T21:52:36Z")

</div>

Are you using any variant of `ConstructorHelpers::FClassFinder` or `ConstructorHelpers::FObjectFinder` ?

If the you are using set paths to objects or classes that are wrong (could have a mistype), it may hang unreal on load. Haven’t tried it during normal recompiles but it can be a culprit of engine hangs.

---

<div class="post-metadata">

**Author:** ![SpectreKelevra](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/spectrekelevra/32/723050_2.png) [@SpectreKelevra](https://forums.unrealengine.com/u/SpectreKelevra)\
**Post date:** [June 25, 2023, 9:55pm UTC](https://forums.unrealengine.com/t/ue-5-2-crashes-often-when-compiling-blueprints/1203416/5 "2023-06-25T21:55:41Z")

</div>

I only work in Blueprint, so would that be the equivalent of “Get all actors of class”?  
If so, I used to in an old version of those blueprints actually, in the construction script, but deleted them because i thought they were causing the hangs.

Edit: In fact, I deleted them because they would error horribly, add hundreds of empty items to the arrays, and just bug out uncontrollably, so I stopped using construction scripts like that altogether, you think there’s a remnant of that code somewhere in this BP?

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [June 26, 2023, 4:46am UTC](https://forums.unrealengine.com/t/ue-5-2-crashes-often-when-compiling-blueprints/1203416/6 "2023-06-26T04:46:35Z")

</div>

Any type of getting actors should be called during or after begin play.

On construct works before other actors spawn in the world.

---

<div class="post-metadata">

**Author:** ![SpectreKelevra](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/spectrekelevra/32/723050_2.png) [@SpectreKelevra](https://forums.unrealengine.com/u/SpectreKelevra)\
**Post date:** [June 26, 2023, 5:06pm UTC](https://forums.unrealengine.com/t/ue-5-2-crashes-often-when-compiling-blueprints/1203416/7 "2023-06-26T17:06:09Z")

</div>

I have no more construction scripts running, I move them all to begin play after the bugs.  
I only have one for a spawner that sets a box extent and some gizmos, but it doesn’t crash the engine.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/7/8/5788265235bbe150a25504e4e4f33e7de29e9286.png)

---

<div class="post-metadata">

**Author:** ![SpectreKelevra](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/spectrekelevra/32/723050_2.png) [@SpectreKelevra](https://forums.unrealengine.com/u/SpectreKelevra)\
**Post date:** [June 27, 2023, 12:49am UTC](https://forums.unrealengine.com/t/ue-5-2-crashes-often-when-compiling-blueprints/1203416/8 "2023-06-27T00:49:07Z")

</div>

Updated main post with some attempts.

---

<div class="post-metadata">

**Author:** ![SpectreKelevra](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/spectrekelevra/32/723050_2.png) [@SpectreKelevra](https://forums.unrealengine.com/u/SpectreKelevra)\
**Post date:** [June 28, 2023, 1:43pm UTC](https://forums.unrealengine.com/t/ue-5-2-crashes-often-when-compiling-blueprints/1203416/9 "2023-06-28T13:43:00Z")

</div>

I found the issue!  
By taking a machete to my code, deleting functions en-masse, and slowly narrowing it down, I found the culprit.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/f/a/4faf2166b1f4441e66e997b967ed35c2398ee970.png)

DO NOT DO THIS ^

I really wish Unreal had a warning or even a regular crash screen instead of just an instant freeze, but oh well, live and learn.

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [June 28, 2023, 3:37pm UTC](https://forums.unrealengine.com/t/ue-5-2-crashes-often-when-compiling-blueprints/1203416/10 "2023-06-28T15:37:08Z")

</div>

Spawning can only occur during or after begin play. The constructor is called before the “World” exists to spawn in objects.

---

<div class="post-metadata">

**Author:** ![SpectreKelevra](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/spectrekelevra/32/723050_2.png) [@SpectreKelevra](https://forums.unrealengine.com/u/SpectreKelevra)\
**Post date:** [June 28, 2023, 3:40pm UTC](https://forums.unrealengine.com/t/ue-5-2-crashes-often-when-compiling-blueprints/1203416/11 "2023-06-28T15:40:33Z")

</div>

This was in the regular event graph, in a custom event, and not in the construction script.  
The problem is when the “spawner” actor is destroyed, that reference is severed with no chance to recover.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/7/c/37c8815927eab38bd0613a7243acb84bd66d7fde.png)

Use this (Dramatic recreation) code to crash Unreal XD

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [June 28, 2023, 3:46pm UTC](https://forums.unrealengine.com/t/ue-5-2-crashes-often-when-compiling-blueprints/1203416/12 "2023-06-28T15:46:29Z")

</div>

You can actually do this if you cache your self class as a variable on begin play and then use it in the spawn 😉

 ![paradox](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/1/d/21d6a1c75ab8268a9b679acccbb1c4f5382da594.png)

---

<div class="post-metadata">

**Author:** ![SpectreKelevra](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/spectrekelevra/32/723050_2.png) [@SpectreKelevra](https://forums.unrealengine.com/u/SpectreKelevra)\
**Post date:** [June 28, 2023, 3:49pm UTC](https://forums.unrealengine.com/t/ue-5-2-crashes-often-when-compiling-blueprints/1203416/13 "2023-06-28T15:49:24Z")

</div>

Oh that’s interesting, what I ended up doing was - indeed - cache the class, but I passed it to a separate spawner BP via interface just to be extra safe.

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/e/e/6ee04827a55bbb960b105f4a0e886a2f9e50f461.png)  
This works well.

Edit: Since I learned something, you earned the “Solution” badge 😃

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [July 28, 2023, 3:50pm UTC](https://forums.unrealengine.com/t/ue-5-2-crashes-often-when-compiling-blueprints/1203416/14 "2023-07-28T15:50:19Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
