- Home /
Changing Texture of one side of cube when raycast is colliding with it.
Alright so basically I have a raycast pointing out from a camera that rotates around a cube. What I want is for that cubes side to turn green when the raycast is touching it. From what I've read, the best way to do this would be to make a cube with a custom UV map that I could then alter inside of my script. The problem is I've just learned what a UV map is about an hour ago so I'm a bit overwhelmed. I'm not sure if this is the correct way to do it so if it is, how do I use a UV map to alter a specific side of a cube's material inside of my script? I'm a Computer Science major and I've never really worked with 3D modeling before, any help would be greatly appreciated!
Answer by michaelfelleisen · Jun 18, 2020 at 07:22 AM
you could make your own cube out of 6 planes and change the color of the plane, which gets hit by the raycast.
that way you dont have to use/understand uv maps at all