From 1030fd2fb9dfc4bfb9c168cab847010a0a64f675 Mon Sep 17 00:00:00 2001 From: sebastianhampel1 Date: Thu, 15 Jun 2023 12:55:42 -0400 Subject: [PATCH] Update PistolComponent.cs --- Assets/Scripts/Item/Pistol/PistolComponent.cs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Assets/Scripts/Item/Pistol/PistolComponent.cs b/Assets/Scripts/Item/Pistol/PistolComponent.cs index 7743c95..af81a5f 100644 --- a/Assets/Scripts/Item/Pistol/PistolComponent.cs +++ b/Assets/Scripts/Item/Pistol/PistolComponent.cs @@ -129,22 +129,17 @@ namespace Item { Fire(!hasCloseTarget); } + + [ServerRpc] - private void SpawnBullet(GameObject projectile) - { - - InstanceFinder.ServerManager.Spawn(projectile); - - } - public void Fire(bool offsetWithTargetBall) { shootLightDuration = 0; shootLight.gameObject.SetActive(true); - var projectile = Instantiate(projectilePrefab, bulletSpawnPoint); - SpawnBullet(projectile); - //var projectile = Instantiate(projectilePrefab, bulletSpawnPoint); + // var projectile = Instantiate(projectilePrefab, bulletSpawnPoint); +var projectile = Instantiate(projectilePrefab, bulletSpawnPoint); + InstanceFinder.ServerManager.Spawn(projectile); //var projectile = Instantiate(projectilePrefab, bulletSpawnPoint); //InstanceFinder.ServerManager.Spawn(projectile);