Update PistolComponent.cs
This commit is contained in:
parent
fb736a036f
commit
f40c0aa770
@ -129,15 +129,23 @@ namespace Item
|
|||||||
{
|
{
|
||||||
Fire(!hasCloseTarget);
|
Fire(!hasCloseTarget);
|
||||||
}
|
}
|
||||||
|
[ServerRpc]
|
||||||
|
private GameObject SpawnBullet()
|
||||||
|
{
|
||||||
|
var projectile = Instantiate(projectilePrefab, bulletSpawnPoint);
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
var projectile = Instantiate(projectilePrefab, bulletSpawnPoint);
|
//InstanceFinder.ServerManager.Spawn(projectile);
|
||||||
|
|
||||||
InstanceFinder.ServerManager.Spawn(projectile);
|
|
||||||
|
|
||||||
|
|
||||||
projectile.transform.localPosition = Vector3.zero;
|
projectile.transform.localPosition = Vector3.zero;
|
||||||
|
Reference in New Issue
Block a user