Update PlayerInteractionHandler.cs

This commit is contained in:
sebastianhampel1 2023-07-14 20:07:57 -04:00
parent 3deb223006
commit c35c73b3a2

View File

@ -76,9 +76,11 @@ public class PlayerInteractionHandler : NetworkBehaviour
shift = GameObject.Find("CameraHidden").GetComponent<CameraShift>();
}
[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();