Attaching a Collision Component to the Character in C++

I’m trying to create a teleport action for my character by teleporting the character to an attached sphere collision component, whose relative location is set in front of the character (this part is done in C++). This is because I want to eventually be able to use this sphere collision component to be able to disable the the teleport action if the collision overlaps with a wall. Then, in Blueprints, I’m trying to use the teleport function with the destination of the character as the collision component. The teleport will be triggered by pressing T (done in Blueprints). I’ve tried so many things to make the attachment and teleport work but it is simply not. Any help?