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

    Micz84

    Joined:
    Jul 21, 2012
    Posts:
    443
    Hi,

    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?

    EDIT:
    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

    OrbitalDuck

    Joined:
    Oct 26, 2013
    Posts:
    54
    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?