Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Is js and c compatible? Can I use both????

Discussion in 'Scripting' started by psyhova, Nov 3, 2016.

  1. psyhova

    psyhova

    Joined:
    Oct 3, 2013
    Posts:
    32
    I have a Script in Java and I want to dissable another script but this is in C.
    I use also

    gameObject.Find("name").GetComponent.(ScriptName).enabled=false;

    This works only if both scripts are in Js. But if the destination script(the script to turn off) is in C, than it doesnt work. Is there a special Code from Js to C?

    Any suggestions?
     
  2. DanielQuick

    DanielQuick

    Joined:
    Dec 31, 2010
    Posts:
    3,137
  3. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    No.

    For all practical purposes you should consider the languages incompatible. Upgrade everything to C#. Forget UnityScript exists.

    There are tricks and work arounds that will work. But you really don't want to go there.
     
  4. psyhova

    psyhova

    Joined:
    Oct 3, 2013
    Posts:
    32
    Thanks for your ansewers and the link.