Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Sorting priority not updated correctly when changed from script.

Discussion in 'High Definition Render Pipeline' started by Micz84, Apr 21, 2023.

  1. Micz84


    Jul 21, 2012

    I have an issue with HDRP/Lit and Hair shader. I have an fbx imported at runtime and I detect hair game object and sub meshes to set up material. Detecting and setting material works OK but sorting order does not have any effect until I modify one of the parameters of material in the inspector. It does not matter which parameter. I have attached screenshots to show how it looks.

    Do I need to do something to make it work?

    I am using Unity 2021.3.9f1 and HDRP 12.1.7
    I have created a simple project with cubes (no runtime importing) and I can also reproduce this issue (added to attachments)

    Attached Files:

    Last edited: Apr 21, 2023
  2. OrbitalDuck


    Oct 26, 2013
    unity 2022.3.10 - Having the same issue with URP, did you find a fix for this? also changing the ztest and unless a property in the editor is changed it doesn't update with script. I have a custom material that does work in a windows build but it wont work in webGL?