Update PistolComponent.cs

This commit is contained in:
sebastianhampel1 2023-06-15 12:55:42 -04:00
parent 0779b443ff
commit 1030fd2fb9

View File

@ -129,22 +129,17 @@ namespace Item
{ {
Fire(!hasCloseTarget); Fire(!hasCloseTarget);
} }
[ServerRpc] [ServerRpc]
private void SpawnBullet(GameObject projectile)
{
InstanceFinder.ServerManager.Spawn(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 = Instantiate(projectilePrefab, bulletSpawnPoint); // var projectile = Instantiate(projectilePrefab, bulletSpawnPoint);
SpawnBullet(projectile); var projectile = Instantiate(projectilePrefab, bulletSpawnPoint);
//var projectile = Instantiate(projectilePrefab, bulletSpawnPoint); InstanceFinder.ServerManager.Spawn(projectile); //var projectile = Instantiate(projectilePrefab, bulletSpawnPoint);
//InstanceFinder.ServerManager.Spawn(projectile); //InstanceFinder.ServerManager.Spawn(projectile);