Hi, i’m new but i programmed with others engine, i want know if i can with script change a mesh of an object in real-time, or of its child object… for example i want if i touch a thing i change the mesh to damaged, i know i can use the “replace” trick, but if i want change the mesh? can i edit the “mesh filter” during the game?
thank’s
Mauro
The MeshFilter component has a variable called “mesh”. You can assign the vertices, triangles, uvs, etc using this - see the docs for the Mesh class to see how it is used.
Hey thanks a lot :)… another question, i don’t want open another topic… but for the FILES I/O ?? i searched and searched but i dont find nothing complete… XML parser is only for online documents? the text asset read all the files… i want a simply file that write for example every line a variable… for example OBJECT 1 can write this to a txt file:
“A”
“B”
3
3333
555
and the OBJECT 2 can read it… but i havent figured how… please help thanks
Mauro
Unity’s API doesn’t really have much in the way of file access, but you can use the Mono libraries. Check out the System.IO library in particular.
mmh… how i can embed this in unity? with c# scripts? (if yes…
im not realy good in C…)
EDIT:: Sorry i’m reading a tutorial thx 