How to interact with objects when facing them?

I’m trying to get a character to interact with locker when looking at it. I already have code that works(with collision box) but if i have item in the locker like key i cant pick it up because of the collision box(locker is keep closing and opening). I tried to use code that im using for opening drawers but is not working.

Uploading: unknown.png…

If you don’t want to change you code too much, you can use multi line trace which will go through all of the objects in front of you, so you can detect of you hit a key and the doors are open, you pick up the key. Otherwise you would have to change the logic on how you detect and open the locker to not overlap with the key.

Hey @TaprauBojan! Welcome to the Forums!

Seems like there was a second image that failed to upload, is that more of your blueprints? Would you mind sharing a video/gif of the issue you are having?

I think I might be able to see what the problem is:

What is your collision like? Is it complex or simple? If it is simple for your locker, the collision will overlap anything inside of it. Would you mind sharing the rest of your blueprint, as well as your collision setup for your locker?

Any additional specifics and information will go a long way in solving your problem!