From c35c73b3a229b23279dd90a16ad7b83936c5aabc Mon Sep 17 00:00:00 2001 From: sebastianhampel1 Date: Fri, 14 Jul 2023 20:07:57 -0400 Subject: [PATCH] Update PlayerInteractionHandler.cs --- Assets/Scripts/Player/PlayerInteractionHandler.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Player/PlayerInteractionHandler.cs b/Assets/Scripts/Player/PlayerInteractionHandler.cs index 34ffc95..db0b1fb 100644 --- a/Assets/Scripts/Player/PlayerInteractionHandler.cs +++ b/Assets/Scripts/Player/PlayerInteractionHandler.cs @@ -76,9 +76,11 @@ public class PlayerInteractionHandler : NetworkBehaviour shift = GameObject.Find("CameraHidden").GetComponent(); } - [ServerRpc] + + [ObserversRpc(ExcludeOwner = true)] public void SwitchWeaponMode() { + GunEnabled = !GunEnabled; if (!GunEnabled) pistol.Disable(); @@ -201,7 +203,7 @@ public class PlayerInteractionHandler : NetworkBehaviour { SwitchWeaponMode(); - if (true) { + if (!IsServer) { GunEnabled = !GunEnabled; if (!GunEnabled) pistol.Disable();