Changing priority from code

Hey guys,

Does anyone know how to change the priority slider from code in URP?

So far I tried :

material.SetInt("_Priority", number);
material.renderQueue = number;
renderer.rendererPriority = number;

But none of this work :frowning:
I tried to take a look at the documentation but nothing is explained about how to change this value.

This maps internally to: Unity - Scripting API: Material.renderQueue

There is some magic here in how this value is calculated that you will need to emulate, see:
https://github.com/Unity-Technologies/ScriptableRenderPipeline/blob/master/com.unity.render-pipelines.universal/Editor/ShaderGUI/BaseShaderGUI.cs#L425