Hi everyone,
I’m having trouble with the Terrain Paint Trees tool in Unity and could use some guidance.
- Color Variation Issue: I’ve set up my trees to be painted using the Terrain Paint Trees tool, and that part works fine. However, I’m struggling with the “Color Variation” feature. The leaves on my trees use a custom shader that has a “_TreeInstanceColor” parameter. From what I’ve read, Unity should recognize this parameter and apply color variations to the leaves, but this doesn’t seem to be happening. I wrote a separate script that randomizes the tree color using this parameter, and it works perfectly when I place the trees as prefabs in the scene.
- Script Execution Issue: My trees have an attached script that doesn’t execute when they are placed using the Paint Trees tool. The script runs without any problems when I place the prefab directly in the scene. Is this normal behavior, or is there a way to make scripts work with trees added via the Paint Trees tool? The script is intended to handle tree destruction.
Are these limitations inherent to the Paint Trees tool, or should I consider another method for adding trees as prefab instances? If so, what alternatives would you recommend? I can’t imagine manually dragging hundreds of trees into the hierarchy.
I appreciate any advice or suggestions you may have! Thank you in advance.