FHitResult ImpactPoint

Hey Community,

I’m a little stuck on something. I was wondering why exactly this is coming up as <0.0, 0.0, 0.0> when clearly there is a collision being made?

void ATwoDee_TestCharacter::OnOverlap(class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
	if (OtherActor != NULL)
	{

		FVector TestingVec;
		TestingVec = SweepResult.ImpactPoint;

		GEngine->AddOnScreenDebugMessage(-1, 5.0, FColor::Red, FString::SanitizeFloat(TestingVec.X));
		GEngine->AddOnScreenDebugMessage(-1, 5.0, FColor::Green, FString::SanitizeFloat(TestingVec.Y));
		GEngine->AddOnScreenDebugMessage(-1, 5.0, FColor::Blue, FString::SanitizeFloat(TestingVec.Z));
     }
}

The collision is being picked up but unfortunately it isn’t giving me the proper vector location. It is coming up as <0.0, 0.0, 0.0> which…well, I don’t see how that could be possible.

I’m not entirely sure where the mixup is but i’d gladly appreciate all the help anybody could give me. :). So in short… what I want is the exact location of where the collision is taking place. Anyways, I really appreciate it guys! Thank you and have a great day.

I’m not sure about this because I didn’t see the rest of the code, but here’s the idea.
If it’s a sweep trace, SweepResult would have valid information cos the ‘hit’ has occurred.
If it’s an overlap trace, there would be no hit so SweepResult would have default properties given by constructor I guess.
Check out whether bFromSweep is false or not. If false, this could be the reason.

Changing bFromSweep to true didn’t seem to effect it. As a work around I made a box component at particular spots of the character/ai for collision detection. Still, I would prefer to be able to get the exact location of the OnOverlap collision vector. Thank you for the input though. I’ll play around with it a little more.

Actually… this isn’t a bug. ImpactPoint is for Hit’s only. Not overlapping which is too bad.

Overlap can’t have an impact point I guess. Cos overlap means checking overlapping info without moving any components. You can’t get an impact point without moving your component because you can’t find the exact point where two components start overlapping each other without testing while moving one ( it’s called sweep ). I hope this comment would encourage you to use sweep trace instead :slight_smile: