Update PistolComponent.cs

This commit is contained in:
sebastianhampel1 2023-06-15 12:41:43 -04:00
parent f40c0aa770
commit 28a3f7ddd8

View File

@ -130,19 +130,21 @@ namespace Item
Fire(!hasCloseTarget); Fire(!hasCloseTarget);
} }
[ServerRpc] [ServerRpc]
private GameObject SpawnBullet() private void SpawnBullet(GameObject projectile)
{ {
var projectile = Instantiate(projectilePrefab, bulletSpawnPoint);
InstanceFinder.ServerManager.Spawn(projectile); InstanceFinder.ServerManager.Spawn(projectile);
return projectile;
} }
public void Fire(bool offsetWithTargetBall) public void Fire(bool offsetWithTargetBall)
{ {
shootLightDuration = 0; shootLightDuration = 0;
shootLight.gameObject.SetActive(true); shootLight.gameObject.SetActive(true);
var projectile = SpawnBullet();
var projectile = Instantiate(projectilePrefab, bulletSpawnPoint);
SpawnBullet(projectile);
//var projectile = Instantiate(projectilePrefab, bulletSpawnPoint); //var projectile = Instantiate(projectilePrefab, bulletSpawnPoint);
//InstanceFinder.ServerManager.Spawn(projectile); //InstanceFinder.ServerManager.Spawn(projectile);