/// <summary> Remove an object from this dropzone and restore its original settings. </summary>
    /// <param name="objectIndex"></param>
    public void RemoveObject(int objectIndex)
    {
        //SenseGlove_Debugger.Log("The script wishes to remove " + objectIndex);
        if (objectIndex >= 0 && objectIndex < this.objectsInside.Count)
        {
            SenseGlove_Debugger.Log("removing " + this.objectsInside[objectIndex].name + " from the DropZone!");
            SenseGlove_Grabable obj = this.objectsInside[objectIndex];

            SenseGlove_Debugger.Log("RBProps.lengh = " + RBprops.Count);

            if (obj.GetComponent <Rigidbody>() != null && RBprops[objectIndex] != null)
            {   //if it is currently picked up, we assign the previous properties to its grabscript, which will then apply them once it lets go.
                SenseGlove_Debugger.Log("It has a physicsBody");
                if (obj.IsGrabbed())
                {
                    obj.SetOriginalParent(this.originalParent[objectIndex]);
                    obj.SetRBProps(this.RBprops[objectIndex][0], this.RBprops[objectIndex][1]);
                }
                else
                {
                    obj.transform.parent        = this.originalParent[objectIndex];
                    obj.physicsBody.useGravity  = this.RBprops[objectIndex][0];
                    obj.physicsBody.isKinematic = this.RBprops[objectIndex][1];
                }
            }

            this.objectsInside.RemoveAt(objectIndex);
            SenseGlove_Debugger.Log("Removed it from ObjectsInside!");
            this.RBprops.RemoveAt(objectIndex);
            this.originalParent.RemoveAt(objectIndex);

            obj.SetInteractable(true); //now the function can also be used to force removal of the object.
            this.OnObjectRemoved(obj);
        }
    }
    // Update is called once per frame
    void Update()
    {
        alleKohlenstoff = GameObject.FindGameObjectsWithTag("Kohlenstoff");
        if (grabable.IsGrabbed())
        {
            for (int j = 1; j <= alleKohlenstoff.Length; j++)
            {
                if (grabable.name != alleKohlenstoff[j - 1].name && grabable.transform.parent.name != "Molekül")
                {
                    if (grabable.GetComponent <Atom>().c0.otherAtomID != alleKohlenstoff[j - 1].GetComponent <Atom>()._id&&
                        grabable.GetComponent <Atom>().c1.otherAtomID != alleKohlenstoff[j - 1].GetComponent <Atom>()._id&&
                        grabable.GetComponent <Atom>().c2.otherAtomID != alleKohlenstoff[j - 1].GetComponent <Atom>()._id&&
                        grabable.GetComponent <Atom>().c3.otherAtomID != alleKohlenstoff[j - 1].GetComponent <Atom>()._id)
                    {
                        alreadyGrabbed = true;
                        distance       = Vector3.Distance(grabable.transform.position, alleKohlenstoff[j - 1].transform.position);
                        if (distance <= 0.25 && (alleKohlenstoff[j - 1].transform.parent != null || alleKohlenstoff.Length <= 2) && !alleKohlenstoff[j - 1].GetComponent <Atom>().isFull)
                        {
                            zwischenSpeicher = alleKohlenstoff[j - 1];
                            alleKohlenstoff[j - 1].GetComponent <Renderer>().material.color = new Color32((byte)redCol, (byte)greenCol, (byte)blueCol, 255);
                            if (startedFlashing == false)
                            {
                                startedFlashing = true;
                                StartCoroutine(FlashObject(distance));
                            }
                            break;
                        }
                        else if (CR_running = true && distance >= 0.25)
                        {
                            startedFlashing = false;
                            StopCoroutine(FlashObject(distance));
                            CR_running = false;
                            if (GameObject.Find("Molekül").GetComponent <EditMode>().editMode == true && GameObject.Find("Molekül").GetComponent <EditMode>().fixedAtom._id != alleKohlenstoff[j - 1].GetComponent <Atom>()._id)
                            {
                                alleKohlenstoff[j - 1].GetComponent <Renderer>().material.color = new Color32(0, 0, 0, 255);
                            }
                            else if (GameObject.Find("Molekül").GetComponent <EditMode>().editMode == false)
                            {
                                alleKohlenstoff[j - 1].GetComponent <Renderer>().material.color = new Color32(0, 0, 0, 255);
                            }
                        }
                    }
                }
            }
        }
        else if (!grabable.IsGrabbed() && alreadyGrabbed == true)
        {
            alreadyGrabbed = false;
            StopCoroutine(FlashObject(distance));
            startedFlashing = false;
            CR_running      = false;

            if (zwischenSpeicher != null && distance <= 0.25 && zwischenSpeicher.GetComponent <Atom>().isFull == false)
            {
                senden.Clear();
                senden.Add(zwischenSpeicher.GetComponent <Atom>());
                senden.Add(grabable.GetComponent <Atom>());
                grabable.transform.parent = GameObject.Find("Molekül").transform;
                if (zwischenSpeicher.GetComponent <Atom>() == GameObject.Find("Molekül").GetComponent <EditMode>().fixedAtom)
                {
                    zwischenSpeicher.GetComponent <Renderer>().material.color = new Color32(255, 0, 0, 255);
                }
                else
                {
                    zwischenSpeicher.GetComponent <Renderer>().material.color = new Color32(0, 0, 0, 255);
                }
                SendMessage("verbindungErstellen", senden);
                zwischenSpeicher = null;
            }
        }
    }