I want to generate a sphere composed of many cubes in UE5.5.1.

I want to generate a sphere composed of many cubes in UE5.5.1.
like this:


And it can interact with touch screen
My current idea is to generate a sphere made up of many cubes first, and then use raycast, but I don’t know how to generate it, so, can someone help me implement it or tell me a simpler idea?
Thank you!