Is overlapping components from two different actors c++

I’m trying to have my characters hand overlap a gun than the gun would attach, but I’m having trouble casting the from the vr character to the gun in c++. I have a working blueprint I’m just having trouble bringing it to c++.
thank you in advance.