public void GetTouchedObject() { //Convert Convert IntPtr To byte[] to String //string myObjStringName = ConverterClass.ConvertIntPtrToByteToString(PluginImport.GetTouchedObjectName());//PluginImport.GetTouchedObjectName() - To be deprecated string myObjStringName = ConverterClass.ConvertIntPtrToByteToString(PluginImport.GetTouchedObjName(1)); Debug.Log("The touched object is " + myObjStringName.ToString()); //If in Manipulation Mode enable the manipulation of the selected object if (PluginImport.GetMode() == 1) { if (PluginImport.GetButton1State()) { if (clickCount == 0) { //Set the manipulated object at first click manipObj = GameObject.Find(myObjStringName); //Setup Manipulated object Hierarchy as a child of haptic cursor - Only if object is declared as Manipulable object if (manipObj != null && !PluginImport.IsFixed(PluginImport.GetManipulatedObjectId())) { //Store the Previous parent object prevParent = manipObj.transform.parent; //Asign New Parent - the tip of the manipulation object device manipObj.transform.parent = myHapticClassScript.hapticCursor.transform; } } clickCount++; } else { //Reset Click counter clickCount = 0; //Reset Manipulated Object Hierarchy if (manipObj != null) { manipObj.transform.parent = prevParent; } //Reset Manipulated Object manipObj = null; //Reset prevParent prevParent = null; } //Only in Manipulation otherwise object are not moving so there is no need to proceed UpdateHapticObjectMatrixTransform(); } }