public void OnTriggerStay2D(Collider2D collision) { if (collision.gameObject.GetComponent <ItemSurface>()) { colliding = true; } if (player.action == true && current_cooldown <= 0.0f) { current_cooldown = pickup_cooldown; if (collision.gameObject.GetComponent <ItemSurface>()) { ItemSurface surface = collision.gameObject.GetComponent <ItemSurface>(); if (surface.fire == null) { if (surface.current_item == null && pickup_object != null) { //if you want to place down an item to an empty surface if (surface.AddItem(pickup_object)) { pickup_object = null; audio.clip = player.drop; audio.Play(); } } else { if (pickup_object) { if (!pickup_object.GetComponent <FireExstinguisher>()) { if (surface.Interact(pickup_object)) { //if interact returns true you take the item instead of interacting with it pickup_object = surface.current_item; surface.current_item = null; audio.clip = player.pickup; audio.Play(); } } } else { if (surface.Interact(pickup_object)) { //if interact returns true you take the item instead of interacting with it pickup_object = surface.current_item; surface.current_item = null; audio.clip = player.pickup; audio.Play(); } } } } } else { Debug.Log(collision.gameObject.name); } } }