Setting the URP material sorting priority by script?

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

3 Likes