Changed some stuff so distance attenuation works for both 3d