fabianom Yeah, a bit complicated setup.
Here's the implementation of what I was talking about. No additional nodes needed, everything is calculated from the cube node itself:
func get_top_die_number(die):
var b = die.global_transform.basis.orthonormalized();
var axis = [ [b.x, 6], [-b.x, 1], [b.y, 2], [-b.y, 5], [b.z, 4], [-b.z, 3] ]
axis.sort_custom(func(v1, v2): return v1[0].y > v2[0].y)
return(axis[0][1])