- Home /
How to display Level of Detail without Unity Pro
HI, I would like to display a kind of Level of Detail on my scene For that I created 3 layers (One with just the floor, one with floor + low def building, and one with hi def building). I want to see the third layer from 0 to 5m, the second from 5 to 20m and the first layer from 20 to 100m. So I put 3 cameras on my First Person Controller which display the respectives layers, but I don't know how to display what I want. I don't have LODGroup because it's Unity Pro only. Any ideas ? Is there any way to put transparency on the layers ?
Answer by rutter · Mar 13, 2012 at 04:15 AM
You could try enabling/disabling renderers based on some criteria, such as a distance check from the current camera.
Answer by soybenito · Mar 14, 2012 at 08:39 PM
From what I read, It looks like a solution. I didn't manage to make it work. I'm not very good at sripting, any more clues about the enable function I should use ?
Answer by soybenito · Mar 14, 2012 at 08:39 PM
Actually I can enable or disable my building, I just need the distance between the object and the camera for my if() something like this ? :
function Update(){
var distance : float;
distance=Vector3.Distance(transform.position, camera.transform.position);
if(distance>5)
{renderer.enable=true;}
if(distance<=5)
{renderer.enable=true;}
}
Your answer
