From 970a2a5697f0402b5b71192df6a1ca53048a84ff Mon Sep 17 00:00:00 2001 From: sebastianhampel1 Date: Fri, 14 Jul 2023 19:39:52 -0400 Subject: [PATCH] changes? --- Assets/Prefabs/GunPrefabs/FlareParticle.prefab | 2 +- Assets/Scripts/Item/Pistol/BulletComponent.cs | 6 +++++- Assets/Scripts/Item/Pistol/PistolComponent.cs | 1 + Assets/Scripts/Player/PlayerInteractionHandler.cs | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Assets/Prefabs/GunPrefabs/FlareParticle.prefab b/Assets/Prefabs/GunPrefabs/FlareParticle.prefab index df41cb3..7bf21f5 100644 --- a/Assets/Prefabs/GunPrefabs/FlareParticle.prefab +++ b/Assets/Prefabs/GunPrefabs/FlareParticle.prefab @@ -180,7 +180,7 @@ MonoBehaviour: _addedNetworkObject: {fileID: 1069525110278255243} _networkObjectCache: {fileID: 1069525110278255243} _componentConfiguration: 0 - _synchronizeParent: 0 + _synchronizeParent: 1 _packing: Position: 1 Rotation: 1 diff --git a/Assets/Scripts/Item/Pistol/BulletComponent.cs b/Assets/Scripts/Item/Pistol/BulletComponent.cs index 1b92341..d51f14b 100644 --- a/Assets/Scripts/Item/Pistol/BulletComponent.cs +++ b/Assets/Scripts/Item/Pistol/BulletComponent.cs @@ -1,8 +1,10 @@ using UnityEngine; +using FishNet.Object; +using FishNet; namespace Item { - public class BulletComponent : MonoBehaviour + public class BulletComponent : NetworkBehaviour { [SerializeField] private float duration = 5f; @@ -22,6 +24,8 @@ namespace Item { register = Item.FlareRegister.instance; register.bullets.Add(this); + this.transform.parent = null; + } // Update is called once per frame diff --git a/Assets/Scripts/Item/Pistol/PistolComponent.cs b/Assets/Scripts/Item/Pistol/PistolComponent.cs index b7c9e3f..f9ef0ff 100644 --- a/Assets/Scripts/Item/Pistol/PistolComponent.cs +++ b/Assets/Scripts/Item/Pistol/PistolComponent.cs @@ -134,6 +134,7 @@ namespace Item [ServerRpc] public void Fire(bool offsetWithTargetBall) { + shootLightDuration = 0; shootLight.gameObject.SetActive(true); diff --git a/Assets/Scripts/Player/PlayerInteractionHandler.cs b/Assets/Scripts/Player/PlayerInteractionHandler.cs index 12563c8..c49419c 100644 --- a/Assets/Scripts/Player/PlayerInteractionHandler.cs +++ b/Assets/Scripts/Player/PlayerInteractionHandler.cs @@ -105,6 +105,7 @@ public class PlayerInteractionHandler : NetworkBehaviour { if (tempInvent.GetQuantityOf(pistol.projectileName) > 0) { + print("Calling RPC:Fire(). Isclient:" + IsClient); pistol.Fire(); noiseManager.ShotFired(); tempInvent.Remove(pistol.projectileName);