Make single face of cube change colour

Hello. Can someone please explain the best way to make the face of a cube change colour when looking at it? I’ve already figured out the “look at” logic using player camera, line tracing etc, but it’s the actual colour change bit I’m struggling with.

ChatGPT suggests using a Post Process Volume, but it wasn’t very helpful. I followed a youtube tutorial where they made the edges glow using PPV (and it worked!), but that’s not what I’m looking for. Plus it was very complicated, and I’m not exactly sure how or why it worked!

Ideally I want 1 of the 6 faces of the cube to change colour (with the other 5 unaffected) depending on which face I’m looking at, but at this point I’d settle for making the whole cube change colour. At least it would be a start!

Any help would be much appreciated.

Well for the whole cube just run a line trace and if it collided call set material on the cube, as far as individual faces, I’m not sure. A work around could be to add decal components to each face of the cube, and use collision events to set visibility. Though that would be very inefficient it could work

Another workaround could be to use 6 planes and and to see which plane a ray cast hit’s and change the color of that plane

1-You need edit the UV Maping of the cube (in Blender for example)
2-Then asing a material to the face you want change the color(in Blender too)
3-Create a dynamic material (in unreal)
4-Asing the matrial to the cube face
5-Change de matarial color using a material dynamic instance when you want
6-DONE!!

You can use a line trace to do it

Do not use it… its answers are random… AI is not intelligent it is just artifitial

1 Like