Enable script on parent

I am trying to get a script on the parent by a certain name and enable or disable it when there is a collision.

void OnCollisionEnter(Collision colliion)
	{
		transform.parent.GetComponent<scriptName>().enabled = false;
	}

According to every other post I have read, this should work. But, the option to enable does not exist. What am I doing wrong?

GetComponent returns type “Component”, which doesn’t have an “enabled” member. Try the following code (assuming your script’s class name is “MyScript”):

void OnCollisionEnter(Collision colliion)
    {
       MyScript script = transform.parent.GetComponent("MyScript") as MyScript;
       if (script)
           script.enabled = false;
    }

Im not an expert in c#, but i think it would look like this

transform.parent.GetComponent<scriptName>().enabled = false;

Just moved the () directly after the script name