Changed if to ternary in instanced mesh. same functionality