Have the base interactable actor class (or anything else that should not accept an item) carry a PlaceNoItemsHere
tag, and query hit components for tags. Or the other way round, tag the shelves instead - whatever seems more natural / convenient.
Additionally, even if the surface should be accepting of placeable objects, what if the object, once put down, starts colliding with adjacent objects?
Either box/sphere trace to find large enough empty space or…
…when the trace hits the surface; you know the transform of the item you’re placing:
Alternatively, set the component you’re plopping down to overlap all, and query for overlaps:
If the array does not return anything conflicting, place the item and revert to the original collision settings. Ideally, you’d have channels / object types set up for those operations. Maybe even a full profile to make it easier in the long run.
Check if Normal is equal to 0,0,1
What about them crooked shelves?!