Why isn't working?

can anyone explaing why this code is not working? the trace just go through the object?

Hello,

Could you provide a screenshot of the collision settings for your bp_big_door_key?

sorry for no cropoing but don’t have access to a cropping tool on this computer.
it is the collision settings on the right there right? everything is on default.

No problem. Have you tried checking the Trace Complex boolean that is located on the Line Trace by Channel node? Depending on how you have your key mesh set up, this may be necessary. Go ahead and give that a shot and see if that helps.

still nothing man! …

That did not work either, I tried with this method but nothing still…

Are you sure you want to use CameraManager for location and forward vector? If you want to get player location and rotation you should probably use GetPlayerPawn. Depending on how your Pawn is set up you might need to use GetPlayerController > GetControlRotation > forward vector.

Edit:
Just noticed you have it inside Character class. In this case you can even call GetActorLocation directly.

This is what I had in mind:

Also, did you set this Character class as Pawn in your GameMode?

with that method the trace does not come from the camera but in the center of the player, but it did not work either, do you mean default pawn class? yes I have set my player through there

Ah, yes, you’re right about that trace start, forgot it’ll go from the center. Well, if you can see the trace lines correctly, then it should be set up OK.

Try this and see if you get any outputs:

Yes it can find everything! so whats wrong with this then?

Ok. Is it detecting the key with the simple print out? If so, are you sure the key in your level is, in fact, the Blueprint and not just a Static Mesh dragged from Content Browser?

wow! didn’t even realise that I had renamed it, but now I have learned…