#hey could someone help me with my
1 messages · Page 1 of 1 (latest)
this is my code
and im trying to generate a map
but when its done the result is
(pls don't look at the colors of everything was still working on it lmao)
part op the problem is probably the trying to use submeshes
First thing I do when debugging meshes is turn on wireframe/shaded wireframe in the scene view
what is your expected results?
uhm an island without holes
i can go back a bit and show what is was
before i tried making everything with the right material
do you want to see it?
if it possibly helps us to help you, sure
i dont know if you can see it good
but like this everything works
cus its one color
do you need this version of the script 2?
oh wow you're doing it in cpp
c#
the link deceives me lmao
oh yeah it has .cpp extension
ooh i did not know wich link to use
Im not familiar with mesh generation, sorry
its okay
I am, but I barely can organize my own mesh gens so trying to debug someone else's massive mesh gen is even harder 😅
did you write the script entirely? Or did you follow some guide/tutorial?
i did entirely
if you have a mesh gen using submeshes i think that would already help me enough to fix it
cus i think i am messing something up with the order im doing things
by the way, SetTriangles can take a List, so you don't have to convert to Array
ooh
and also SetVertices etc
@opal wigeon so you are adding triangles like this:
Etriangles.Add(Etriangles.Count);
maybe you should do
Etriangles.Add(vertices.Count - 1);
no, only for triangles, and possibly UVs.
Vertices are shared between submeshes
for uvs does channel matter
which is why I think you should try this ^
actually nvm UVs, I think they are shared between submesh
but how does one mesh know wichone belongs to what other
eventho uv's are all just 1
think its more about verts
verts are also just 1
verts and uvs use the same indices
so a triangle that has vert index 4, also points to uv of index 4
so forget UVs for now and try the fix I suggested.
first change the 1 to 0 here:
mesh.SetUVs(1,uvs);
because 0 is the first channel which you are using.
alright! got that😁
and uh
ill have to dissapoint you
YOU DID IT
i forgot that you cant see something without a material
🥳
so thats why we could only see the top
mesh generation can be so painful trust me I've lost my mind so many times with it
np, good luck from now on 😁