Download

Tracing Issue on 4.14

So, i cant really figure why my exact same code for tracing doesnt work correctly on 4.14

Using the following code for tracing


void AWeapon::Tick(float DeltaSeconds)
{
	Super::Tick(DeltaSeconds);

	FVector TraceStart;
	FVector TraceEnd;

	int i;
	FHitResult HitData(ForceInit);
	FCollisionQueryParams Params;
	Params.bTraceComplex = true;
	Params.bReturnPhysicalMaterial = false;

	StartSockEnd = Mesh->GetSocketLocation(SocketStartName); //
	EndSockEnd = Mesh->GetSocketLocation(SocketEndName);
	

	/* if we should trace*/
	if (bTrace)
	{

		for (i = 0; i<TracesPerSwing; i++)
		{
			TraceStart = FMath::Lerp(StartSockEnd, EndSockEnd, i / TracesPerSwing);
			TraceEnd = FMath::Lerp(A, B, i / TracesPerSwing);
			TestThing(TraceStart, TraceEnd);	
		}
		
		A = StartSockEnd;
		B = EndSockEnd;
		}
		
}

// tracing occurs here


void AMeleeWeapon::TestThing(FVector Start, FVector End)
{
	FHitResult HitData(ForceInit);
	FCollisionQueryParams Params;
	Params.bTraceComplex = true;
	Params.bReturnPhysicalMaterial = false;


	DrawDebugLine(Instigator->GetWorld(), Start, End, FColor::Red, false, 9, 0, 1.0);
	
	if (Target->GetMesh()->LineTraceComponent(HitData, Start, End, Params))
	{
		OnHit(HitData);
		DrawDebugLine(Instigator->GetWorld(), Start, HitData.ImpactPoint, FColor::Green, false, 9, 0, 1.0);
	}

}

I get perfect results on UE4 4.12 , 4.13 as you can see in this example video

https://youtube.com/watch?v=vPWdR3KHnj8

However, here is the same code running on 4.14

https://youtube.com/watch?v=fZqxRT3s_Co

As you can see the trace somehow hits the character even when im not near it

And the socket , start & end locations are correct as you can see trough the debug red line. however when used in the LineTraceComponent function it goes crazy
Whats funny is that if i use the LineTraceSingleByObject / any other trace function, it works perfectly fine. it only performs that weird detection when im using the LineTraceComponent function

Any help is greatly appreciated :slight_smile: