Attach to actor c++ function can't accept USkeletalMesh as parent's actor parameter

Hi, i’m working on a TabTargeting system and after a few hours trying to solve this i gave up and now i’m asking to you.
This is my problem:
I spawned an actor to the currently targetted enemy, the actor is supposed to attach on a specific socket (created in the mannequin skeleton), but it doesn’t attach to that, instead it does attach to the enemy target, but in the middle of the target (looks like he found the target, but didn’t find the socket).
this is the function i used to attach:
//i’m trying to attach TargetAnim to TargetEnemy, TargetEnemy is a pawn , TargetAnim is an actor

FAttachmentTransformRules rules(EAttachmentRule::SnapToTarget,true);
USkeletalMeshComponent* mesh = TargetEnemy->FindComponentByClass();
if (mesh) {
TargetAnim->AttachToComponent(mesh, rules, FName(TEXT(“Target”)));

the visual studio editor tells me that USkeletalMeshComponent* (mesh), is incompatible with USceneComponent*

Are you getting this as a compiler error or Intellisense? If its just a red underline try building anyways, Intellisense isn’t always right when it comes to large projects like UE4.