diff --git a/Assets/Scripts/Item/Pistol/PistolComponent.cs b/Assets/Scripts/Item/Pistol/PistolComponent.cs index 660bc48..77657c1 100644 --- a/Assets/Scripts/Item/Pistol/PistolComponent.cs +++ b/Assets/Scripts/Item/Pistol/PistolComponent.cs @@ -129,15 +129,23 @@ namespace Item { Fire(!hasCloseTarget); } + [ServerRpc] + private GameObject SpawnBullet() + { + var projectile = Instantiate(projectilePrefab, bulletSpawnPoint); + + InstanceFinder.ServerManager.Spawn(projectile); + return projectile; + } public void Fire(bool offsetWithTargetBall) { shootLightDuration = 0; shootLight.gameObject.SetActive(true); - - var projectile = Instantiate(projectilePrefab, bulletSpawnPoint); + var projectile = SpawnBullet(); + //var projectile = Instantiate(projectilePrefab, bulletSpawnPoint); - InstanceFinder.ServerManager.Spawn(projectile); + //InstanceFinder.ServerManager.Spawn(projectile); projectile.transform.localPosition = Vector3.zero;