# BlueprintNativeEvent Garbage collection interference??

**URL:** <https://forums.unrealengine.com/t/blueprintnativeevent-garbage-collection-interference/510681>\
**Category:** C++\
**Tags:** UE4-5, unreal-engine, UE4-26, question\
**Created:** [March 29, 2022, 5:05pm UTC](https://forums.unrealengine.com/t/blueprintnativeevent-garbage-collection-interference/510681 "2022-03-29T17:05:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![InfinaWorks](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@InfinaWorks](https://forums.unrealengine.com/u/InfinaWorks)\
**Post date:** [March 29, 2022, 5:05pm UTC](https://forums.unrealengine.com/t/blueprintnativeevent-garbage-collection-interference/510681/1 "2022-03-29T17:05:37Z")

</div>

I’m working on a plugin and have implemented an overrideable function (BlueprintNativeEvent) that’s working correctly 90% of the time…

The exception is once every minute it seems as if the function call is skipped entirely.

I have tried a lot of different declarations, specifier combinations and variants on the definition as well but am still getting the same weird behavior in unreal UE5 preview 2 as in engine 4.26 (PIE and stand alone).

.h

```
UFUNCTION(BlueprintCallable, BlueprintNativeEvent, CallInEditor)
	struct FHitResult CustomSpawnPointFunction(FVector2D Position);

virtual struct FHitResult CustomSpawnPointFunction_Implementation(FVector2D Position);

```

.cpp

```auto
struct FHitResult AProceduralInstanceSpawner::CustomSpawnPointFunction_Implementation(FVector2D Position)
{
	struct FHitResult Hit;

	AsyncTask(ENamedThreads::GameThread, [this]()
	{
		Print("Custom function not overridden.", 3, FColor::Orange, -1);
	}
	);

	return Hit;
}

```

In code:

```auto
//Use custom function
	if (TraceMethod == UseCustomFunction)
	{
		OutHit.bBlockingHit = false;
		OutHit = CustomSpawnPointFunction(TracePosition);

		if (!OutHit.bBlockingHit)
		{
			Print("Custom function returning false.", 3, FColor::Red, -1);

			return false;
		}

		return true;
	}

```

Once every minute the “Custom function returning false” message is printed even though blocking hit is set to true in the override.

Never had a function behaving like this before. Anybody got a clue on what’s going on??
