From 28a3f7ddd8b0ecbf2898e7a8119ec18285633731 Mon Sep 17 00:00:00 2001 From: sebastianhampel1 Date: Thu, 15 Jun 2023 12:41:43 -0400 Subject: [PATCH] Update PistolComponent.cs --- Assets/Scripts/Item/Pistol/PistolComponent.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/Item/Pistol/PistolComponent.cs b/Assets/Scripts/Item/Pistol/PistolComponent.cs index 77657c1..33d5421 100644 --- a/Assets/Scripts/Item/Pistol/PistolComponent.cs +++ b/Assets/Scripts/Item/Pistol/PistolComponent.cs @@ -130,19 +130,21 @@ namespace Item Fire(!hasCloseTarget); } [ServerRpc] - private GameObject SpawnBullet() + private void SpawnBullet(GameObject projectile) { - var projectile = Instantiate(projectilePrefab, bulletSpawnPoint); + InstanceFinder.ServerManager.Spawn(projectile); - return projectile; + } public void Fire(bool offsetWithTargetBall) { shootLightDuration = 0; shootLight.gameObject.SetActive(true); - var projectile = SpawnBullet(); + + var projectile = Instantiate(projectilePrefab, bulletSpawnPoint); + SpawnBullet(projectile); //var projectile = Instantiate(projectilePrefab, bulletSpawnPoint); //InstanceFinder.ServerManager.Spawn(projectile);