Help

Hi there , i was following the Weapon essentials tutorials, and at this point , when i press play in editor it crashes…

In visual studio get this error message :

Unhandled exception at 0x00007FFA4F89A14E (UE4Editor-pap.dll) in UE4Editor.exe: 0xC0000005: Access violation reading location 0x0000000000000368.

And also it pointed me into this line , wich i dont see any error :


void AWeapon::Fire()
{
	if (ProjectileType == EWeaponProjectile::EBullet)
	{
		GEngine->AddOnScreenDebugMessage(-1, 2.f, FColor::Blue, TEXT("Bullet"));
		Instant_Fire();
	}
	if (ProjectileType == EWeaponProjectile::Espread)
	{
		GEngine->AddOnScreenDebugMessage(-1, 2.f, FColor::Blue, TEXT("Spread"));
		for (int32 i = 0; i <= WeaponConfig.WeaponSpread; i++)
		{
			Instant_Fire();
		}
	}
	if (ProjectileType == EWeaponProjectile::EProjectile)
	{
		GEngine->AddOnScreenDebugMessage(-1, 2.f, FColor::Blue, TEXT("Projectile"));
	}
		
}

Does any one know how to fix this ?
Thanks

Use the debugger, go up the callstack, inspect variable values. Some pointer somewhere is being dereferenced while null and/or invalid.