And this one is better mainSampler.setAttribute(6, value ? 2 : 40); mainSampler.setAttribute(2, value ? 1 : 40); 6: Amount 2: Soft Limit