From 080f9a342821f2c5815347d14e4a0380a1dffa82 Mon Sep 17 00:00:00 2001 From: Santi Date: Sun, 28 Apr 2024 19:00:11 +0100 Subject: [PATCH] Created Scripts Folder --- Assets/{ => Scripts}/Movement.cs | 0 Assets/{ => Scripts}/Movement.cs.meta | 0 Assets/{ => Scripts}/PickUpObject.cs | 5 +++-- Assets/{ => Scripts}/PickUpObject.cs.meta | 0 4 files changed, 3 insertions(+), 2 deletions(-) rename Assets/{ => Scripts}/Movement.cs (100%) rename Assets/{ => Scripts}/Movement.cs.meta (100%) rename Assets/{ => Scripts}/PickUpObject.cs (90%) rename Assets/{ => Scripts}/PickUpObject.cs.meta (100%) diff --git a/Assets/Movement.cs b/Assets/Scripts/Movement.cs similarity index 100% rename from Assets/Movement.cs rename to Assets/Scripts/Movement.cs diff --git a/Assets/Movement.cs.meta b/Assets/Scripts/Movement.cs.meta similarity index 100% rename from Assets/Movement.cs.meta rename to Assets/Scripts/Movement.cs.meta diff --git a/Assets/PickUpObject.cs b/Assets/Scripts/PickUpObject.cs similarity index 90% rename from Assets/PickUpObject.cs rename to Assets/Scripts/PickUpObject.cs index 4fabcf9..dbea3ba 100644 --- a/Assets/PickUpObject.cs +++ b/Assets/Scripts/PickUpObject.cs @@ -11,6 +11,7 @@ public class PickUpObject : MonoBehaviour public bool carrying = false; public GameObject carriableObject; public float throwForce; + public KeyCode interactKey = KeyCode.F; // Start is called before the first frame update void Start() { @@ -20,12 +21,12 @@ public class PickUpObject : MonoBehaviour // Update is called once per frame void Update() { - if(insideTrigger && Input.GetKeyDown(KeyCode.F) && !carrying) + if(insideTrigger && Input.GetKeyDown(interactKey) && !carrying) { carrying = true; carriableObject.GetComponent().isKinematic = true; } - else if(carrying && Input.GetKeyDown(KeyCode.F)) + else if(carrying && Input.GetKeyDown(interactKey)) { carrying = false; carriableObject.GetComponent().isKinematic = false; diff --git a/Assets/PickUpObject.cs.meta b/Assets/Scripts/PickUpObject.cs.meta similarity index 100% rename from Assets/PickUpObject.cs.meta rename to Assets/Scripts/PickUpObject.cs.meta