From 91e43f9b3a91c6b3f45ce3f288446b6cba2e5ed5 Mon Sep 17 00:00:00 2001 From: Santi Date: Sun, 28 Apr 2024 17:20:37 +0100 Subject: [PATCH] Unity: Throwable Objects Changed throw button from D to F --- Assets/Movement.cs | 10 +++++----- Assets/PickUpObject.cs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Assets/Movement.cs b/Assets/Movement.cs index dadd67c..46b8b64 100644 --- a/Assets/Movement.cs +++ b/Assets/Movement.cs @@ -27,9 +27,13 @@ public class Movement : MonoBehaviour if (Input.GetAxis("Horizontal") != 0 || Input.GetAxis("Vertical") != 0) { Quaternion ToRotation = Quaternion.LookRotation(new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"))); - throwForce.throwForce = 7.5f; + throwForce.throwForce = 8.5f; transform.rotation = Quaternion.RotateTowards(transform.rotation, ToRotation, turnSpeed * Time.deltaTime); } + else + { + throwForce.throwForce = 4.0f; + } moveDirection = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical")); @@ -41,10 +45,6 @@ public class Movement : MonoBehaviour { throwForce.throwForce = 20.0f; } - else - { - throwForce.throwForce = 5.0f; - } } else { diff --git a/Assets/PickUpObject.cs b/Assets/PickUpObject.cs index 96c812d..4fabcf9 100644 --- a/Assets/PickUpObject.cs +++ b/Assets/PickUpObject.cs @@ -20,12 +20,12 @@ public class PickUpObject : MonoBehaviour // Update is called once per frame void Update() { - if(insideTrigger && Input.GetKeyDown(KeyCode.D) && !carrying) + if(insideTrigger && Input.GetKeyDown(KeyCode.F) && !carrying) { carrying = true; carriableObject.GetComponent().isKinematic = true; } - else if(carrying && Input.GetKeyDown(KeyCode.D)) + else if(carrying && Input.GetKeyDown(KeyCode.F)) { carrying = false; carriableObject.GetComponent().isKinematic = false;