It’s to do with how you’re setting up the cube pointer. Obviously the variable can only point at one cube
The reference needs to be set as you ‘approach’ the cube. Typically, a line trace is used for that. You can have a line trace going from the hand to whatever is in front of it.
Then you can pick up the object.
EDIT: Another way would be to have a collision capsule around the hand, that would overlap with the object and give you a reference.
This sort of thing
The hand needs a collision volume on it.