Update PistolComponent.cs

This commit is contained in:
sebastianhampel1 2023-06-15 12:40:11 -04:00
parent fb736a036f
commit f40c0aa770

View File

@ -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 = SpawnBullet();
//var projectile = Instantiate(projectilePrefab, bulletSpawnPoint);
var projectile = Instantiate(projectilePrefab, bulletSpawnPoint);
InstanceFinder.ServerManager.Spawn(projectile);
//InstanceFinder.ServerManager.Spawn(projectile);
projectile.transform.localPosition = Vector3.zero;