# Help with what's causing the engine to crash

**URL:** <https://forums.unrealengine.com/t/help-with-whats-causing-the-engine-to-crash/2708665>\
**Category:** C++\
**Tags:** crashes, unreal-engine, question\
**Created:** [March 24, 2026, 7:11pm UTC](https://forums.unrealengine.com/t/help-with-whats-causing-the-engine-to-crash/2708665 "2026-03-24T19:11:04Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![AMadLad](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/amadlad/32/1153301_2.png) [@AMadLad](https://forums.unrealengine.com/u/AMadLad)\
**Post date:** [March 24, 2026, 7:11pm UTC](https://forums.unrealengine.com/t/help-with-whats-causing-the-engine-to-crash/2708665/1 "2026-03-24T19:11:04Z")

</div>

Here’s what the crash log says:

Unhandled Exception: EXCEPTION\_ACCESS\_VIOLATION reading address 0x0000000000000000

UnrealEditor\_Project\_2703!BlueprintFunctionScriptThing::function() [C:\Users\Admin\Documents\Unreal Projects\Project5.0\Source\Project\Private\BlueprintFunctionScriptThing.cpp:42]  
UnrealEditor\_Project\_2703!BlueprintFunctionScriptThing::exefunction() [C:\Users\Admin\Documents\Unreal Projects\Project5.0\Intermediate\Build\Win64\UnrealEditor\Inc\Project\UHT\BlueprintFunctionScriptThing.gen.cpp:135]  
UnrealEditor\_CoreUObject  
UnrealEditor\_CoreUObject  
UnrealEditor\_CoreUObject  
UnrealEditor\_CoreUObject  
UnrealEditor\_CoreUObject  
UnrealEditor\_CoreUObject  
UnrealEditor\_CoreUObject  
UnrealEditor\_CoreUObject  
UnrealEditor\_CoreUObject  
UnrealEditor\_Engine  
UnrealEditor\_Engine  
UnrealEditor\_Engine  
UnrealEditor\_Engine  
UnrealEditor\_UnrealEd  
UnrealEditor\_UnrealEd  
UnrealEditor  
UnrealEditor  
UnrealEditor  
UnrealEditor  
UnrealEditor  
UnrealEditor  
kernel32  
ntdll

I narrowed it down to the player pawn, but not sure why it has to do with it crashing

---

<div class="post-metadata">

**Author:** ![Infant\_Zero](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/infant_zero/32/715655_2.png) [@Infant\_Zero](https://forums.unrealengine.com/u/Infant_Zero)\
**Post date:** [March 25, 2026, 1:36am UTC](https://forums.unrealengine.com/t/help-with-whats-causing-the-engine-to-crash/2708665/2 "2026-03-25T01:36:40Z")

</div>

This post may help:

[Unhandled Exception: EXCEPTION\_ACCESS\_VIOLATION reading address 0x0000000000000000 - Development / Programming & Scripting - Epic Developer Community Forums](https://forums.unrealengine.com/t/unhandled-exception-exception-access-violation-reading-address-0x0000000000000000/752651/10)

---

<div class="post-metadata">

**Author:** ![Dumple1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dumple1](https://forums.unrealengine.com/u/Dumple1)\
**Post date:** [March 25, 2026, 11:07am UTC](https://forums.unrealengine.com/t/help-with-whats-causing-the-engine-to-crash/2708665/3 "2026-03-25T11:07:33Z")

</div>

> [@AMadLad](#):
>
> Unhandled Exception: EXCEPTION\_ACCESS\_VIOLATION reading address 0x0000000000000000
> 
> UnrealEditor\_Project\_2703!BlueprintFunctionScriptThing::function() [C:\Users\Admin\Documents\Unreal Projects\Project5.0\Source\Project\Private\BlueprintFunctionScriptThing.cpp:42]  
> UnrealEditor\_Project\_2703!BlueprintFunctionScriptThing::exefunction() [C:\Users\Admin\Documents\Unreal Projects\Project5.0\Intermediate\Build\Win64\UnrealEditor\Inc\Project\UHT\BlueprintFunctionScriptThing.gen.cpp:135]  
> UnrealEditor\_CoreUObject  
> UnrealEditor\_CoreUObject  
> UnrealEditor\_CoreUObject  
> UnrealEditor\_CoreUObject  
> UnrealEditor\_CoreUObject  
> UnrealEditor\_CoreUObject  
> UnrealEditor\_CoreUObject  
> UnrealEditor\_CoreUObject  
> UnrealEditor\_CoreUObject  
> UnrealEditor\_Engine  
> UnrealEditor\_Engine  
> UnrealEditor\_Engine  
> UnrealEditor\_Engine  
> UnrealEditor\_UnrealEd  
> UnrealEditor\_UnrealEd  
> UnrealEditor  
> UnrealEditor  
> UnrealEditor  
> UnrealEditor  
> UnrealEditor  
> UnrealEditor  
> kernel32  
> ntdll
> 
> I narrowed it down to the player pawn, but not sure why it has to do with it crashing

The problem is a null pointer: you are trying to access a memory pointer that has not been initialized yet, so it is `nullptr`.

Let’s take a look at this file.  
BlueprintFunctionScriptThing.cpp:42

---

<div class="post-metadata">

**Author:** ![AMadLad](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/amadlad/32/1153301_2.png) [@AMadLad](https://forums.unrealengine.com/u/AMadLad)\
**Post date:** [March 25, 2026, 9:00pm UTC](https://forums.unrealengine.com/t/help-with-whats-causing-the-engine-to-crash/2708665/4 "2026-03-25T21:00:33Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/optimized/4X/d/8/a/d8a89fe95734db78b2d52fe439ac6d9181e5d8cc_2_690x22.png)

```auto
{
				UNiagaraComponent* particlesystem = UNiagaraFunctionLibrary::SpawnSystemAttached(DebrisSystem, impactobject, NAME_None,FVector::ZeroVector, FRotator::ZeroRotator, EAttachLocation::KeepRelativeOffset, true, true, ENCPoolMethod::None, true);
				particlesystem->AttachToComponent(impactobject, FAttachmentTransformRules::SnapToTargetIncludingScale, NAME_None);
				if (IsValid(impactobject->GetOwner()))
				{

```

---

<div class="post-metadata">

**Author:** ![Countsie](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/countsie/32/1194632_2.png) [@Countsie](https://forums.unrealengine.com/u/Countsie)\
**Post date:** [March 25, 2026, 9:22pm UTC](https://forums.unrealengine.com/t/help-with-whats-causing-the-engine-to-crash/2708665/5 "2026-03-25T21:22:35Z")

</div>

To prevent the crash, verify DebrisSystem and impactobject are valid before the spawnsystemattached is called… something along the lines of:  
if(!DebrisSystem || !impactobject)  
{return;}

Then verify you have a valid particlesystem after you create it, in case it fails to create the system. Add some logging in there to output what you’re missing.

---

<div class="post-metadata">

**Author:** ![AMadLad](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/amadlad/32/1153301_2.png) [@AMadLad](https://forums.unrealengine.com/u/AMadLad)\
**Post date:** [March 26, 2026, 1:13am UTC](https://forums.unrealengine.com/t/help-with-whats-causing-the-engine-to-crash/2708665/6 "2026-03-26T01:13:10Z")

</div>

like this?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/9/d/09dff5f64cf758ebe030f41f49f0cd4372f828f4.png)

```auto
							if (IsValid(DebrisSystem)||IsValid(impactobject))
					{
						UNiagaraComponent* particlesystem = UNiagaraFunctionLibrary::SpawnSystemAttached(DebrisSystem, impactobject, NAME_None,FVector::ZeroVector, FRotator::ZeroRotator, EAttachLocation::KeepRelativeOffset, true, true, ENCPoolMethod::None, true);
						if (IsValid(DebrisSystem) || IsValid(impactobject))
						{
							if (IsValid(DebrisSystem) || IsValid(impactobject))
							{
								particlesystem->AttachToComponent(impactobject, FAttachmentTransformRules::SnapToTargetIncludingScale, NAME_None);
								
							}
							else UE_LOG(LogTemp, Log, TEXT("CrashIndicator"));
							if (IsValid(impactobject->GetOwner()))
							{
								particlesystem->SetNiagaraVariableActor("BuildingModule", impactobject->GetOwner());
							}
							particlesystem->SetNiagaraVariableFloat("Scale", 1);
							UNiagaraDataInterfaceArrayFunctionLibrary::SetNiagaraArrayInt32(
								particlesystem,
								FName("MeshIndexes"),
								meshindexes

							);
							TArray<int32> rendereditems = UNiagaraDataInterfaceArrayFunctionLibrary::GetNiagaraArrayInt32(
								particlesystem,
								"MeshIndexes"

							);

							particlesystem->SetVisibleFlag(true);
							for (int i = 0; i < rendereditems.Num() - 1;i++)
							{
								//UE_LOG(LogTemp, Log, TEXT("Index: %i"), rendereditems[i]);
							}
							impactobject->SetVisibility(false);

						}
						else UE_LOG(LogTemp, Log, TEXT("CrashIndicator"));
						

```

---

<div class="post-metadata">

**Author:** ![Countsie](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/countsie/32/1194632_2.png) [@Countsie](https://forums.unrealengine.com/u/Countsie)\
**Post date:** [March 26, 2026, 3:31am UTC](https://forums.unrealengine.com/t/help-with-whats-causing-the-engine-to-crash/2708665/7 "2026-03-26T03:31:56Z")

</div>

You only need to validate them once before they are used to make sure they are pointing to an invalid object before using them. If the object is invalid, it will crash as you’ve seen, you want to catch these situations and handle them.

generally its easier and cleaner to validate inputs at the beginning of the function. If they aren’t valid, early out by 'return’ing. add a log entry in the block with the return so you know why it didn’t complete the function.

then after you create and populate the particlesystem pointer, do a:

```auto
if(!particlesystem)
{
  UE_LOG(LogTemp, Log, Text("Error creating particle system, invalid"));
  return;
}

```

---

<div class="post-metadata">

**Author:** ![AMadLad](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/amadlad/32/1153301_2.png) [@AMadLad](https://forums.unrealengine.com/u/AMadLad)\
**Post date:** [March 26, 2026, 3:35am UTC](https://forums.unrealengine.com/t/help-with-whats-causing-the-engine-to-crash/2708665/8 "2026-03-26T03:35:07Z")

</div>

I’ll try that tomorrow and see if it worked

---

<div class="post-metadata">

**Author:** ![AMadLad](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/amadlad/32/1153301_2.png) [@AMadLad](https://forums.unrealengine.com/u/AMadLad)\
**Post date:** [March 26, 2026, 3:48pm UTC](https://forums.unrealengine.com/t/help-with-whats-causing-the-engine-to-crash/2708665/9 "2026-03-26T15:48:23Z")

</div>

fixed, I tried with that code and without it and the one without it crashed and the other one didn’t, thank you
