Is This Possible

I want to make a script where i can use my “PickUpObject” script and move them into the back of a vehicle and store them there untill n take them out using the “PickUpObject” script.

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

public class PickUpObject : MonoBehaviour
{
    public Transform theDest;

    public Player Player;

    void Update()
    {
          
    }


    void OnMouseDown()
    {
        GetComponent<BoxCollider>().enabled = false;
        GetComponent<Rigidbody>().useGravity = false;
        this.transform.position = theDest.position;
        this.transform.parent = GameObject.Find("Item Dest").transform;
    }
    void OnMouseUp()
    {
        GetComponent<BoxCollider>().enabled = true;
        this.transform.parent = null;
        GetComponent<Rigidbody>().useGravity = true;
    }
}

This is a great start, but you might want to review some tutorials on picking up stuff and dropping it. There’s a lot of other subtle details omitted from the above code, such as moving it to the right place once it is picked up and parented, or placing it back into the world in a way that is reasonable and keeps it from falling through other objects or falling through the floor.

Also, this script appears mildly confused between if it is doing the picking up of another object that was clicked, or it assumes it is the thing itself that is clicked. Review how that is set up in some of the tutorials.

Okay i will do thank you