How to set up LODs for a Asset Store pack in Unity Indie?

I’m not making a game I’m selling models on the asset store. I plan to get Unity pro but can not afford it now.

I know I can’t fully configure an LOD prefab in the free version but is there a way to set the prefabs or imports up so Unity pro will set it up?


Since you’re just making models to distribute on the Asset Store, here are a couple suggestions:

  1. Include the LOD meshes in the model but don’t provide a prefab. Let the customer use Unity Pro to add an LODGroup and assign the meshes as appropriate. Make sure to name the meshes so it’s obvious which LOD group they belong to. It’s not that much extra effort for the customer.
  2. Wait until all your models are ready, and then set up the prefabs in the trial version of Pro. I’m not sure if this is legit, but it may be allowable since you’re just setting up the prefabs for the convenience of Pro users, not using Pro yourself per se. You might want to check with the Asset Store folks before trying this.

@TonyLi gave good suggestions, but here’s the technical aspect of what you want to do. Quoting from Unity - Manual: Level of Detail (LOD) for meshes :

LOD-based naming conventions in the asset import pipeline
In order to simplify setup of LODs, Unity has a naming convention for models that are being imported.

Simply create your meshes in your modelling tool with names ending with _LOD0, _LOD1, _LOD2, etc., and the LOD group with appropriate settings will be created for you.

Note that the convention assumes that the LOD 0 is the highest resolution model.

This should mean you can just set the naming convention and it will automatically pick up. I couldn’t make it work in practice, but it should work eventually. And, even if it doesn’t work, it’s just drag n’ drop the prefab into the lod group, quite easy.

Also, since your title is still confusing, I’ll answer it separately as well, just like @inkspot did, but with [code from the wiki][1]:

Automatically set LOD Levels of models
(C)2010 by Tom Vogt
Use and modify as you wish, but retain author credits (aka BSD license)
== Usage ==
* Create an empty gameobject
* Drag all LOD levels into it, so they become children of the LOD object
* Attach this script to the empty gameobject
* Set the number of meshes in the script, and drag them into the slots, from highest (closest) to lowest (far away)
* Set the number of distances to 
one less

than the number of meshes (beyond the highest distance will use the most far away mesh automatically)
* Set the distances at which the script shall switch to the next lowest LOD. So the first number means “at this distance or less, use the highest LOD”.
* Press Play and drag the camera around to check if your distances are fine.

public var Distances : float[];
public var Models : GameObject[];
private var current = -2;
function Start() {
	for (var i=0; i<Models.Length; i++) {
  • }*

function Update() {

  • var d = Vector3.Distance(camera.main.transform.position, transform.position);*
  • var stage = -1;*
  • for (var i=0; i<Distances.Length; i++) {*
    _ if (d<Distances*) {_
    if (stage==-1) stage=Distances.Length;_
    if (current!=stage) {_

function SetLOD(stage) {
* Models[stage].SetActiveRecursively(true);*
* if (current>=0) Models[current].SetActiveRecursively(false);*
* current = stage;*

You could use the camera to get and detect the distance away from the prefab and use like thresholds to load the LOD mesh on your prefab: LOD1 loads when 50units away from camera, LOD2 loads when 100 units away from camera etc.