private void Shoot(Vector2 target) { GameObject projectile = Object.Instantiate(projectilePrefab, shotingPoint.position, shotingPoint.rotation); ProjectileBehaviour projectileActions = projectile.GetComponent <ProjectileBehaviour>(); if (targetIsEnemy) { projectile.layer = 13; } else { projectile.layer = 14; } projectileActions.Damage = troopData.valDamageDealt; projectileActions.MoveToTarget(target); }