diff --git a/Assets/Mirror/Examples/TopDownShooter/Scripts/PlayerTopDown.cs b/Assets/Mirror/Examples/TopDownShooter/Scripts/PlayerTopDown.cs index ae79d76cc..197ad408e 100644 --- a/Assets/Mirror/Examples/TopDownShooter/Scripts/PlayerTopDown.cs +++ b/Assets/Mirror/Examples/TopDownShooter/Scripts/PlayerTopDown.cs @@ -183,15 +183,7 @@ IEnumerator GunShotEffect() [Command] public void CmdFlashLight() { - if (flashLightStatus == true) - { - flashLightStatus = false; - } - else - { - flashLightStatus = true; - } - RpcFlashLight(); + flashLightStatus = !flashLightStatus; } // our sync var hook, which sets flashlight status to the same on all clients for this player @@ -199,13 +191,6 @@ void OnFlashLightChanged(bool _Old, bool _New) { #if !UNITY_SERVER flashLight.enabled = _New; -#endif - } - - [ClientRpc] - void RpcFlashLight() - { -#if !UNITY_SERVER soundFlashLight.Play(); #endif }