The ‘sorting priority’ setting breaks in my game - is there a way to set the material sorting priority in URP vi script? Google does not return anything.
Any advice would be greatly appreciated.
The ‘sorting priority’ setting breaks in my game - is there a way to set the material sorting priority in URP vi script? Google does not return anything.
Any advice would be greatly appreciated.
Hey there! Ran into the same issue recently but I couldn’t be able to make it work.
URP Lit shaders have the “_QueueOffset” property that change the renderQueue of the material. Technically, if you can update that float, the renderQueue will change as well. But I haven’t been able to do it in runtime, so there might be another way.
material.renderqueue=xxx
that’s all
Hey, I’ve also run into this problem. ununion’s solution works but you should be careful because, as far as I can tell, with shaders whatever you change in runtime is still changed after you stop playing and there is nothing in the editor to show you in which value the rendederqueue ended up. I found doing material.SetFloat("_QueueOffset", newVal) actually changes the Sorting Priority that you see in the editor so I just set the rendererqueue back to 3000 and used that, so I can tell in which value it ended. Also it uses more normal numbers, I just change it between 0 an -1.