public class PickUp : MonoBehaviour
{
void OnMouseDown()
{
this.transform.position = target.position;
this.transform.parent = GameObject.Find(“FPSController”).transform;
this.transform.parent = GameObject.Find(“FirstPersonCharacter”).transform;
}
void OnMouseUp()
{
this.transform.parent = GameObject.Find("FPSController").transform;
this.transform.parent = null;
}
}