Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  3. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug Build fail if no lit-material presented in scene

Discussion in 'Project Tiny' started by todans, Feb 3, 2021.

  1. todans

    todans

    Joined:
    Mar 4, 2014
    Posts:
    12
    Way to repro - make all materials used in scene unlit. Build will fail with this:

    Exception: IndexOutOfRangeException: Index 0 is out of range of '0' Length.
    at Unity.Collections.NativeArray`1[T].FailOutOfRangeError (System.Int32 index) [0x00080] in <82ec470c913149358ad0c83ad628910c>:0
    at Unity.Collections.NativeArray`1[T].CheckElementReadAccess (System.Int32 index) [0x0001a] in <82ec470c913149358ad0c83ad628910c>:0
    at Unity.Collections.NativeArray`1[T].get_Item (System.Int32 index) [0x00001] in <82ec470c913149358ad0c83ad628910c>:0
    at Unity.TinyConversion.MeshConversion.OnUpdate () [0x002a0] in E:\Work\Git\tiny_playables\playable_1\Library\PackageCache\com.unity.tiny@0.32.0-preview.54\Unity.Tiny.Rendering.Authoring\ConvertMesh.cs:561
    at Unity.Entities.ComponentSystem.Update () [0x00076] in E:\Work\Git\tiny_playables\playable_1\Library\PackageCache\com.unity.entities@0.17.0-preview.41\Unity.Entities\ComponentSystem.cs:114
    at Unity.Entities.ComponentSystemGroup.UpdateAllSystems () [0x000fb] in E:\Work\Git\tiny_playables\playable_1\Library\PackageCache\com.unity.entities@0.17.0-preview.41\Unity.Entities\ComponentSystemGroup.cs:472
     
  2. AbdulAlgharbi

    AbdulAlgharbi

    Unity Technologies

    Joined:
    Jul 27, 2018
    Posts:
    319
    It should work make sure to use Universal Render Pipeline/Unlit

    upload_2021-2-3_10-58-0.png
     
  3. todans

    todans

    Joined:
    Mar 4, 2014
    Posts:
    12
    That's the point) if I make all materials urp\unlit - build will fail with the message above. If I add just one urp/lit material (even it's not visible, but used in any mesh in scene) - everything works well.
    I use tiny version 0.32
     
  4. todans

    todans

    Joined:
    Mar 4, 2014
    Posts:
    12
    Turned out that this error happens if urp-unlit material is used on skinned mesh renderer and there is NO any urp-lit material in scene.
     
  5. AbdulAlgharbi

    AbdulAlgharbi

    Unity Technologies

    Joined:
    Jul 27, 2018
    Posts:
    319
    I confirm with skinned meshes I see the issue
    I've created a ticket and will try to get you a fix by the next tiny release