Quick question about GetComponent.

Hello everybody :slight_smile: ,
I have a problem, so help me please.
How can I get a component from an object with c# script - object.GetComponent()
if ScriptExample is a java script.

using UnityEngine;
using System.Collections;

public class CountDown : MonoBehaviour {
    private GameObject opponent;

    void Start () {

    opponent=GameObject.FindWithTag("aicar");
        if(!opponent) {Debug.Log("don't exist the car");}
        else{Debug.Log("exist the car");} // that part works fine.
    }

    void Update () {
          GameStart();  
    }

    public void GameStart() {
         opponent.GetComponent<Aicar>().enabled=false; // ***
       }
}

***the type or namespace ScriptExample could not be found. Are you missing a using directive an assembly reference?

You need to put your JavaScript files into a “Standard Assets” or “Plugins” folder as per: Unity - Scripting API:

This way they’re compiled before the C# so that they’re accessible once Unity gets around to compiling your C# code.