- Home /
Change Mat/Texture of Procedural Chunk Combind Meshes
Many procedural mesh systems use game objects or dont combine meshes when using chunks. My system uses Chunk loads and combines the smaller meshes into one bigger one. There are also no game objects.
So since theres no game object, when I raycast and calculate the coordinate of the system, how exactly do I access them? Currently the system has the Chunk stored in a array of 2 Chunks[,] and Im reprogramming it all to have a height now of 2-3 so now Chunks[ , , ]. Awesome. But how do I change an individual material/texture of the square? I have the current chunks painting properly but Id like for it to apply at the level of affecting each grid square only NOT THE CHUNK.
Currently each tile is a size of 1 unit in unity. The chunks are 10 at the moment and the map size is 100x100. (These are all testing purposes but wont go any larger than 250x250.
Here are some images to better illustrate and for future references
Chunksize of 10 (paints whole chunk)
Chunksize of 1 (individual are tile as I want it to be)
Update: So I found out I cant reference to a child because theres none in the chunk themselves. Whoops. So I went ahead and used a raycast method to find coords properly but I am not sure how to change the materials of the mesh since they are CO$$anonymous$$BINED. Would I have to split or something?
Help would be greatly appreciated!