My GetClosestPointOnCollision Compiles but causes UE4 to crash - Help!

Hi

Made a custom pawn with skeleton mesh as root, all works great.
Made custom movement component for sliding along surfaces, all work great.

Now I’m trying to get more detail on collisions but game crashes when I call “GetClosestPointOnCollision” or my custom function below, this all compiles but crashes the game maybe someone can explain what I’m doing wrong or point out a better way of doing this. A distance value will suffice, as the only four point that should touch anything are at the same distance, I know Cause the same function in Blueprints does work.

bool ASkelPawnBase::IsCollisionPointInRange(FHitResult ColHit)
{
	FVector TempOutPointOnBody;
	const float ColPoint = ToClosestPointOnCollision(ColHit.ImpactPoint, TempOutPointOnBody, "None");

	if ((ColPoint > 28) && (ColPoint < 33))
	{
		return true;
	}
	return false;
}

float ASkelPawnBase::ToClosestPointOnCollision(const FVector& Point, FVector& OutPointOnBody, FName BoneName)const
{	
	OutPointOnBody = Point;
	UPrimitiveComponent TBodyInst;

	if (FBodyInstance* BodyInst = TBodyInst.GetBodyInstance(BoneName, /*bGetWelded=*/ false))
	{
		return BodyInst->GetDistanceToBody(Point, OutPointOnBody);
	}
	return -1.f;
}

Please Help!
Thanks Garth

PS. before 4.12 used to just get the bone name from the hit results worked Great, but now it gives me the bone name of the other skeletal mesh if one is doing the Hitting. But bullets don’t have skeletons!!! and why does the bullet need to know what bone it hit when it’s about to get destroyed!!

Hi, so I think in this project I used a skeletal mesh as root and physics asset for collision and that caused the crash.
I redid this using a custom collision mesh almost the same shape as the skeletal mesh which is attach the collision mesh.
But now I just use hit.location compared to bone.location and I’m doing it multiple times per frame, it works and uses less code!