Hello everyone, I’m new to unity and learning how to make a VR experience .
I’m trying to pick up an object using reticle on click. I can pick it up and can’t figure out how to drop it.
This is the script I’m using:
#pragma strict
//A private var to store whatever the Parent GameObject is
private var targetParent:GameObject;
//Set the variable that stores the Parent GameObject
public function setTargetParent(t:GameObject){
targetParent = t;
}
//Set the child to be a child of the parent
public function Pickup(targetChild:GameObject){
targetChild.transform.parent = targetParent.transform;
}
This is what I have in GameObject EventTrigger