Note that it is not “m_InstanceID == 0”, it’s “m_InstanceID != 0”. This is my method that’s producing the error:
public void RemoveFromLayer(int layer, Collider2D col = null) {
if(col != null) {
foreach(Collider2D refCol in colLayerArray[layer]) {
if(refCol != null) {
Physics2D.IgnoreCollision(refCol, col, true);
}
}
colLayerArray[layer].Remove(col);
}
}
colLayerArray is of type List< Collider2D >. It’s apart of a system I’ve made that allows for multiple layers (rendering and collision) in 2D. For example, multiple floors on a building in a top-down game.
If anyone could please explain how to fix the error, I would very much appreciate it.