GetComponent is not a generic defintion error? (167782)

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..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.().useGravity = true;
}`

1 Answer

1

I tried re-editing it with the 101010 button but that’s how it formatted to. I think I figured out my issue with the GetComponent part. But now my gameobject won`t parent to the holder.