Search Unity

Bug Editor crashed on RaycastHit.textureCoord when scene is loaded from an AssetBundle

Discussion in 'Editor & General Support' started by LightStriker, Dec 2, 2021.

  1. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Unity 2021.1.27

    When doing a "textureCoord" off a collider from a RaycastHit, the game pops;
    Then promptly goes;
    Doesn't happen in a build, only the editor.
     
  2. dforstmaier

    dforstmaier

    Joined:
    Oct 5, 2016
    Posts:
    13
    I suddenly had the same error recently. Editor worked fine, it only appeared when I was using Addressables in combination of "Use Existing Build". WebGL and PC build did not show any error messages, but the targeted mesh was not properly drawn (which is depending on a successfull raycast hit).
    Long story short, I solved it by setting read/write to enabled *AND* build new asset bundles with this setting. Maybe this helps you too.

    Also, this thread helped me a little bit: https://github.com/microsoft/MixedRealityToolkit-Unity/issues/7632