- Home /
Painting Textures onto Terrain Via Script
Hey everyone!
I'm making an RTS style game at the moment and I have everything in had apart from a map generator.
I have a good idea of how to make one but I am missing the most crucial part of the code. Paint.
What I'm going to do is have the game produce a random number ranging from 10,50 for up and down and for each number do another random one for left and right. Might be complicating and resource demanding but it'll get the job done. Hopefully.
So, here's the code I need. i want to paint a texture on the terrain for each one of those numbers.
i.e. say the height is 27 and so it paints a 1*27 line upwards and so on.
So do you guys know of any type of code?
Appreciate all comments and help you guys (or gals) have to offer!
Bit hard to follow your description - can you draw a picture of what you want? You mean you want the number "27" to be drawn onto the terrain like a decal texture (or projector)?
Oh no not at all. All I really want is just a way to paint a texture onto a 1*1 square really, Using a script of course.
O$$anonymous$$. So you need to use SetAlpha$$anonymous$$aps to set the relative weight of each of the splat textures at that point: http://docs.unity3d.com/ScriptReference/TerrainData.SetAlphamaps.html
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Multiple Cars not working 1 Answer
2D Terrain 1 Answer
[BEGINNER] Generating Terrain with Perlin noise flat and nothing happens ? 1 Answer