Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    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