- Home /
DetailPrototype
How do I add a DetailPrototype Mesh version at runtime? I have tried to fix this issue for a couple of days now, but can't seem to find a solution. Is this even possible if not I would love to know, so I can try to find a workaround instead. I have tried to assign the prototype value of the DetailPrototype. My code for generation of the detail prototypes:
detailProtoTypes = new DetailPrototype[detail.Length];
for (int d = 0; d < detail.Length; d++) {
detailProtoTypes[d] = new DetailPrototype();
detailProtoTypes[d].renderMode = DetailRenderMode.Grass;
detailProtoTypes[d].prototype = detail[d];´
}
I assign it later on. If I check in the Terrain Inspector it shows missing, and when I click edit on it, it is set to the normal detailprototype which doesn't take a GameObject as a parameter. (The one that takes a Texture)
Answer by ExtremePowers · Feb 24, 2015 at 07:05 PM
I finally got it working, I didn't know about the "DetailPrototype.usePrototypeMesh = value", since it wasn't documented, this could most certaintly be added to the documentation, as the prototype value depends on it.
Your answer
![](https://koobas.hobune.stream/wayback/20220613184136im_/https://answers.unity.com/themes/thub/images/avi.jpg)