Character Picks up Objects THROUGH other Objects

So I hope this makes sense, but I’m currently implementing a pick up system as well as interaction with doors, drawers, etc… So, when I put an object INSIDE of a drawer, I can pick up an object without first opening the drawer, meaning I can simply just grab the item from the side of the cabinet (or whatever structure holds the object) . The drawers and all other objects do have proper collision set up. Is there a way to make it so that the player must be able to directly see the object before it picks it up?

I was going to include screen shots but Unfortunately my internet is so slow and unreliable that I get an error when trying… But I do have line traces for both types of interactions. (door+object pick up)

thanks !

Hey there, you can try creating a custom interact trace channel and make the drawers ignore it, while the items block it and when you do the trace you do it using that new trace channel instead of visibility. Another option is create a new object type called Item or Object, and set the items to that type, then you do a trace by object instead of trace by channel.

That’s what I was thinking, but I think you need the drawer to block the trace or the object will get hit. Then in the trace result you can ignore drawers. I’ll put the other option in a separate answer.

You could give your drawer a list of the objects it contains. Then when the drawer is opened, you enable its contents so they become interactible. Conversely, when it is closed, you disable all its contents.

I understood the question the other way around :stuck_out_tongue: If you use visibility line trace and the drawer blocks that then it should work.