LineTrace check hit component

i have 2 UBoxComponents HitBoxHead and HitBoxBody

Error says TWeakObjectPtr can only be compared with UObject types

if (HitResult.Component == "HitBoxHead")
 {
     // do something
 {
 else
 {
      // do something
 {

If you want to compare names, then you need to get the name of the component:

	if (OutHit.GetComponent()->GetName() == "HitBoxHead")
	{
		// do something
	}
	else
	{
		// do something
	}