Help with error in unity.

Error CS1061: Type UnityEngine.Object' does not contain a definition for GetComponent’ and no extension method GetComponent' of type UnityEngine.Object’ could be found. Are you missing an assembly reference? (CS1061) (Assembly-CSharp)

I think the placement of your parens is off here…

Crate obs = ((GameObject)Instantiate(TypeOfObstacles[j], freePositions[pointsIndex].position, Quaternion.identity).GetComponent<Crate>());

Try this instead:

Crate obs = ((GameObject)Instantiate(TypeOfObstacles[j], freePositions[pointsIndex].position, Quaternion.identity)).GetComponent();