Usual fix for this is to put Ball in a Family, and for the level variable make it a Family variable, then you can pick the two objects individually one is Ball and the other is Family, so Ball on collision with Family, if ball.level = family.level etc