How to make any dice have a given face(int) face up?

Basically I have 4,6,8,10,20 sided dices, they work fine for rolling and everything but now I want to implement a feature where if you click a dice with value of 2, it’ll rotate to have 5/6 facing up…pretty sure I need math but am really bad with it…

You could check on click if it is ‘2’ then trigger an animation that ‘flips’ it to the desired side up.