Failed setting triangles. Some indices are referencing out of bounds vertices. IndexCount: 6, VertexCount: 6
UnityEngine.Mesh:SetTriangles(Int32[ ], Int32)
I don’t know where the error is coming from but, i get this this error only two time out of 3. (2rd and 3th, SetPixelUpdate())
This is hard to explain so here’s the script… [Pastbin File]
it’s not working because “vertices” is not an array, array can’t use Count; I will explain my goal.
I use SetPixelUpdate for create an pixel at X and Y position. The ColorId string is used for get the submesh. Each submesh have it’s own materials, exemple: SetPixelUpdate(0, 0, “Red”); The program will find the submesh id witch is assing with the red material. My problem is the SetTriangle function doesn’t work…
WOAH! All the pixels are there but these have no any color.
ResetScreen();
SetPixelUpdate(1,1, “Red”);
SetPixelUpdate(1,2, “Blue”);
SetPixelUpdate(1,3, “Green”); turn into Black Black Black.
You are not setting any normals. That seems to be the problem for the colors.
I can’t quite understand what you mean by, all the triangles are added in the first submesh by default. I will test it when I have more time, and I’ll come back with some feedback.
All triangles are added into the default submesh but the default submesh is black. I think that is why pixles are all black. I’ll me too try to invert black with another color for see if the color change.
Maybe it will work if i create an “empty material” submesh, all triangles will by default added in this be submesh but, this submesh have no materials, so the main (red, blue, green, yellow and else) will give a color to the pixel. Again, sorry for extremely bad english