private void Laser() { targetEnemy.TakeDamage(damageOverTime * Time.deltaTime); targetEnemy.Slow(slowPercent); // graphics if (!lineRenderer.enabled) { lineRenderer.enabled = true; impactEffect.Play(); impactLight.enabled = true; } lineRenderer.SetPosition(0, firePoint.position); lineRenderer.SetPosition(1, target.position); Vector3 direction = firePoint.position - target.position; // put the effect on the enemy border impactEffect.transform.rotation = Quaternion.LookRotation(direction); impactEffect.transform.position = target.position + direction.normalized * (target.localScale.x / 2); if (!isPlayingSound) { audioSource.loop = true; audioSource.clip = fireSound; audioSource.volume = volumeFire; audioSource.Play(); isPlayingSound = true; } }