Search Unity

JS just wont work!

Discussion in 'Editor & General Support' started by robertseadog, Aug 15, 2005.

  1. robertseadog

    robertseadog

    Joined:
    Jul 23, 2005
    Posts:
    374
    I made this little test script:
    Code (csharp):
    1. function Update () {
    2. var Mycamera = Camera.main.transform;
    3. Mycamera.parent = transform;
    4. }
    (so it's JS)

    When I try to drag it onto a cube, a messagebox appears:

    I don't see what's wrong, when I try to do a simple parent it just won't!
    Im using 1.1b2 by the way..
     
  2. Richard_B

    Richard_B

    Joined:
    Jul 22, 2005
    Posts:
    436
    Mmmm... just tried it, works fine here (1.1b2) :?

    Richard.

    PS Try re-launching Unity.
     
  3. robertseadog

    robertseadog

    Joined:
    Jul 23, 2005
    Posts:
    374
    Tried restarting.. Actually no JS scripts work, only C, weird hugh?

    I'll try restarting, or reinstalling :?
     
  4. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    "The script needs to successfully compile and inherit from MonoBehavior."

    It says that because your script has compile errors. Open unity's console to see and fix them.

    Since the script seems to have no apparent compile errors, you most likely have a compile error in some of your other scripts.
     
  5. robertseadog

    robertseadog

    Joined:
    Jul 23, 2005
    Posts:
    374
    Thats the weird part; I tried with a new scene and a flawless script- exactly the same message when I try to drag it onto a model! I'll reinstall it, maybe that'll fix it..
     
  6. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    1) Change one line in one of your scripts, this will compile your scripts again and show you any compile errors you have in them.
    Eg. add an empty line in one of your scripts

    2) Open the unity console, take a screenshot of it and post it.

    Reinstalling unity will not change anything.
    Next beta will contain a fix so that compile errors will not be removed when restarting unity.
     
  7. robertseadog

    robertseadog

    Joined:
    Jul 23, 2005
    Posts:
    374
    Hmm, I'll try that, but what would be cool also would be to have some sort of syntax sorting in the editor(like in flash), im sure that would decrease theese sort of mistakes as Im most likely having now..

    [EDIT] Restarted and Made a new project, works now.. :?: [/EDIT]