Attach object only if the object is inside a collision

You could do a check when you attempt to attach by calling GetOverlappingActor.
Or you could use a boolean when you begin the overlap with the backpack.

Would one of those work?