Изменил спавн пули

This commit is contained in:
2026-05-19 20:14:40 +03:00
parent 893353a41c
commit 4cb295785e
2 changed files with 11 additions and 5 deletions
+3 -3
View File
@@ -23,13 +23,13 @@ public class TurretBullet : MonoBehaviour
Destroy(gameObject);
}
public TurretBullet Spawn(Turret turret, Vector3 direction)
public TurretBullet Spawn(Turret turret, Vector3 spawnPoint, Vector3 direction)
{
var rot = turret.transform.rotation;
rot.SetLookRotation(direction);
var bullet = Instantiate(this, turret.transform.position, rot, turret.transform);
var bullet = Instantiate(this, spawnPoint, rot, turret.transform);
bullet._damage += turret.Damage;
bullet._distance += turret.Distance;
bullet._distance += turret.Distance - Vector3.Distance(spawnPoint, bullet.transform.position);
return bullet;
}