Created Scripts Folder
This commit is contained in:
parent
4e51e6d212
commit
080f9a3428
@ -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<Rigidbody>().isKinematic = true;
|
||||
}
|
||||
else if(carrying && Input.GetKeyDown(KeyCode.F))
|
||||
else if(carrying && Input.GetKeyDown(interactKey))
|
||||
{
|
||||
carrying = false;
|
||||
carriableObject.GetComponent<Rigidbody>().isKinematic = false;
|
Loading…
Reference in New Issue
Block a user