Hi, I am new to coding and I was working on a javascript which would allow my character to pick up and drop down a game object on mouseup and on mousedown. But unity Api Updater is saying that “GetComponent” is not a generic definition. I`ve been trying for quite some time now to figure out what the heck it means. Here is the code:
var onhand : Transform;
function Update () {
}
function OnMouseDown() {
GetComponent.<Rigidbody>.useGravity = false;
this.transform.posistion = onhand.posistion;
this.transform.parent = GameObject.Find("FPSController").transform;
this.transform.parent = GameObject.Find("FirstPersonController").transform;
}
function OnMouseUp() {
this.transform.parent = null;
GetComponent.<Rigidbody>().useGravity = true;
}