Depth mask works in editor but not in play mode

I’m attempting to use a depth mask to hide a plane with a transparent/diffuse texture on it. It works great in the unity editor, but as soon as I hit play the plane with the texture on it can be seen as though the mask weren’t there at all. Could anyone tell me why this is happening and how I might fix it?

Below is the shader and the render queue script I’ve got on the masking object:

Shader "Masked/Mask" {
 
	SubShader {
 
		Tags {"Queue" = "Geometry+10" }
 
		ColorMask 0
		ZWrite On
 
		Pass {}
	}
}
using UnityEngine;

[AddComponentMenu("Rendering/SetRenderQueue")]

public class SetRenderQueue : MonoBehaviour {
	
	[SerializeField]
	protected int[] m_queues = new int[]{3000};
	
	protected void Awake() {
		Material[] materials = renderer.materials;
		for (int i = 0; i < materials.Length  i < m_queues.Length; ++i) {
			materials[i].renderQueue = m_queues[i];
		}
	}
}

It seems to me that you are initializing your m_queues with one int valued at 3000. Besides that you are doing ++i instead of i++. So it seems the render queue loop isn’t doing anything.

Aah I see, thank you. I copied that script from the internet since I haven’t messed with render queues before. After changing the render queue on what I was masking it started working. Didn’t even notice the ++i error before posting it here, glad you pointed that out.