Hello! i'm trying to make a grid and before i tried it and i realized it used to many polygons because i used cubes. So i decided to make each segment as a terrain so each one has 4 polygons instead of 8 like a cube, but the problem is the terrain segments don't have a mesh renderer. So i can't change the color of them like i need to. So does anyone know how i would change the color of the terrain during runtime so like if i put my mouse over the segment it would turn green. My code is:
function OnMouseOver(){
renderer.material.color = Color.green;
}
but i get a error:
**'there is no 'Renderer' attached to 'Segment' but a script is trying to access it'**
the **'Segment'** part is the name of my terrain. And by the way this script goes on each of the segments. There should be 4624 terrain segments.
↧