How can I interact the object I'm holding with something else?

Hi. I made a game that includes holding objects and placing them into a cabinet. I have properly implemented the holding action and interaction system. However, I cannot combine these two. I want to place them in a specific location.

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using VHS;

public class PickingController : MonoBehaviour
{


    [SerializeField] private Transform playerCameraTransform;
    [SerializeField] private Transform objectGrabPointTransform;
    [SerializeField] private LayerMask pickUpLayerMask;
    private PickableObject pickableObject;
    InteractableBase interactableBase;
    public static bool canDrop;

    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.E))
        {
            if (pickableObject == null)
            {
                // Not carrying an object, try to grab
                float pickUpDistance = 4f;
                if (Physics.Raycast(playerCameraTransform.position, playerCameraTransform.forward, out RaycastHit raycastHit, pickUpDistance, pickUpLayerMask))
                {
                    if (raycastHit.transform.TryGetComponent(out pickableObject))
                    {
                        pickableObject.PickUp(objectGrabPointTransform);
                    }
                }
            }
            else
            {
                if(canDrop == true)
                {
                    pickableObject.Drop();
                    pickableObject = null;
                }
                // Currently carrying something, drop
            }
        }
    }
}

This is for interaction

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace VHS
{
    public class DestroyInteractable : InteractableBase
    {


        PickableObject pickableObject; 
        public override void OnInteract()
        {
            base.OnInteract();
            Debug.Log(gameObject);
            PickableObject.objectGrabObject.transform.position = Vector3.zero;
        }
    }

}

Usually one just implements an “interact” feature on the target container (cabinet) so you can drop your item off.

It’s complicated… you might just want to implement a “leave this thing in space right here” function and go from there.

Seems to be able to specifically place it you would need some kind of “area controller” that you can interact with while holding something else, and that area controller would take over listening to input and let you select where to drop the item. One area controller might be the interior of a cupboard, another might be the top surface of a table, or even the floor. I dunno, never tried to go that containerly-accurate in the real physical world.

It is basically an Overcooked-style interaction. I want to pick up an item and place it on a counter. Also, could you explain what an ‘Area Controller’ is? If you have any source videos or similar resources, could you please share them with me?

I mean it generically: anything like a surface in 2D or 3D where things can be placed.

Code Monkey has a massive 10-11 hour tutorial showing how to make a game exactly like that from the ground up.

https://www.youtube.com/watch?v=AmGSEH7QcDg