public void Shakecamera(float strength, float duration) { float distance = (transform.position - player.position).magnitude; float falloff = Mathf.Max(0, distance); mainCamera.ShakeCamera(strength - falloff, duration); }