From 663906298868ac22fe340bd5d69b1d46efd9a79a Mon Sep 17 00:00:00 2001 From: Tucan444 Date: Tue, 20 Jul 2021 18:23:19 +0200 Subject: [PATCH] _ --- Assets/Scripts/PlayerControls.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/PlayerControls.cs b/Assets/Scripts/PlayerControls.cs index f566a4d..8ca6402 100644 --- a/Assets/Scripts/PlayerControls.cs +++ b/Assets/Scripts/PlayerControls.cs @@ -28,7 +28,11 @@ public class PlayerControls : MonoBehaviour jumping = Input.GetButton("Jump") || Input.GetAxisRaw("Vertical") > 0; crouching = Input.GetButton("Crouch") || Input.GetAxisRaw("Vertical") < 0; animator.SetFloat("Horizontal_speed", horizonatalaxis); - switchy = Input.GetButton("Switch"); + + if(Input.GetButtonDown("Switch")) { + switchy = !switchy; + } + if (switchy){ transform.rotation = new Quaternion(0f, 0f, 180f, 0f); rigidbody.sharedMaterial = top;