Hi all Just wanted to share a simple LOD script I have made. I did a search for one earlier and could find one that fitted my requirements, so decided to make one myself. It is fairly optimized and should be idiot proof Anyway here it is hope someone will find it useful. Documentation is in the file
Before I read the actual commentary in the script, I had no clue what LOD stood for. But actually it seems quite useful! Thanks! But, and excuse me, what do lod1, lod2, and lod3 do?
lod0 is max detail, lod2 is min detail. you need to put a lower detailed mesh in lod1 and lod2 (fewer polygons)
Oh, so like a sample object for how many polys all the others get? And does this work for automatic leveling? (not dragging and dropping every single gameobject into a variable?)
nope no automatic stuff. I suggest you use prefabs with the script and lower level objects already attached. see attachment: EDIT: ohh I see I forgot to mention that you need to tag your player with a tag named "Player"
This is interesting, I was messing with many variations of this as well. Does your script assume the LOD1 and LOD2 are already on the stage in the spot they need to be in. (meaning placed in the scene) ??
As far as i can see, i could say: yes it does. The only thing the script does, is to enable/disable the lods depending on the distance and, of course, its existence. The script could be more generic and iterate through the children of the object where the script is attached to... but i guess 3 levels of lod are fine enough. Thanks Westmark!
Thank You, very useful i converted the script to C# and modified it to use less CPU The modified script is attached.