How can I detect which face of a cube was hit by line trace?

you could also use the dot product of the hit normal so you don’t have to involve the cube size.