I have a cube with different coloured sides.

I have a line trace set up to determine if the cube is being looked at and to provide a hit location.

I need to work out from this which side is being looked at.

So far I have it working if the cube hasn’t rotated at all.

I get the actor location and minus the hit location which gives me a vector where one of the values will be 50 or -50 (The cube is 100 units square).

From this I can determine which of the six sides is active.

I’m not sure how to get this to work when rotated.

I thought that maybe I could somehow rotate the hit location around the cubes centre point by the same amount that the cube has rotated and calculate it from that new point?

Does that make any sense?

Is it possible at all?