- Home /
Can't change color of terrain during runtime... [SOLVED]
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.
don't terrains have like 250,000 polygons
you want a plane
and not a unity plane, an actual four-vertex plane imported from a 3d modeling program
Your answer
![](https://koobas.hobune.stream/wayback/20220613105804im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Terrain(using unity Mesh) colouring with LibNoise 1 Answer
Need help with the inventory 1 Answer
Changing the color/look of a grass textures/grass. Making it look clean. 0 Answers
Life script how to add. 1 Answer
Make a simple tree 1 Answer