How check if an object reference is in a list of references?

I want to check if a component I click on is in a list/set of components that I manually specify beforehand. This is my rolling cabinet blueprint:

It has drawers that can be opened or closed. I obtain the component that my player character has clicked on through an Interaction Interface like this:

image

So I want to check if HitComp is in DrawersRef, which I was told I can do with the Contains Node. I’ve plugged a Map variable into the Contains node, but I can already tell that this is not what i want. What I essentially need is just a set (unordered list) of object references, which I can fill with the object references of my drawers. I can explain this better in python pseudo code, since that is where I learned how to code.

Pseudo Code:

drawers_set = {TopDrawer, MiddleDrawer, BottomDrawer}

if HitComp in drawers_set:
        return True

So what I would need for this is a variable that I can fill with references to the Drawers SM Components in my blueprint. Once I have this variable, I can do the Contains check and if that returns true, I can run logic that will open or close a specific drawer.

Can I make a set of references to manually selected SM Components of my Blueprint Actor Class?

You can just use a set, instead of a map :slight_smile: ( it’s another variable type ).

Ok so I just only realised that you can select the drop down next to Variable Type to specify the container type. I didn’t know that this is how you distinguish between containers for a type of element inside the container. But I can’t find any references to my drawers in the details pane.

When I try to search for Top Drawer in the Set elements I can’t find anything.

You probably need a set of static mesh component object references? ( I’m assuming that’s what your drawers are ).

they are in the outliner, but how do I reference them in the set?
image

Yes, you can’t pick them from a list, because it doesn’t work like that with components. But you can do it in construction

or