x


Unity is not updating my scripts

I recently have run into a problem where Unity will let me modify and create new scripts, save them, but not apply any changes in the game. For example, I modified a script that previously asked for Gameobject Variable in the Inspector to now ask for a String. The script saved, and shows up every time I look at it Unitron, but the Inspector still is using the old version of the code. I can't figure out how to get it to realize that the script has changed. This is also applicable to new code, as I can write and save new .JS files but Unity will not recognize that they exist beyond in the Project pane. I assume there is a problem with permissions but I can't figure out where. How do I kickstart Unity into reading my new files?

I have worked with this project on several computers, tried reimporting all assets, and even tried on a PC (I work with Macs primarily).

more ▼

asked May 17 '10 at 12:34 AM

karl_ gravatar image

karl_
2.4k 41 53 70

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

The problem was a misplaced semi-colon in a main menu script.

    var NewGame_Level : String = "beepoc_test_level";
var Instr_Level : String = "instructions";

function Update()
{
    if( Input.GetButton("Jump") )
    {
        Application.LoadLevel(NewGame_Level);
    } //END IF NEW GAME

    if( Input.GetButton("XBOX_Y") )
    {
        Application.LoadLevel(Instr_Level);
    } //END IF INSTRUCTIONS

    if( Input.GetButton("XBOX_B") )
    {
        Application.Quit();
    }//END IF QUIT
}//END FUNCTION Update

@script RequireComponent(CharacterController)  // <-- There was a semi colon here.  This prohibited all other scripts from compiling any changes.
more ▼

answered May 17 '10 at 01:16 AM

karl_ gravatar image

karl_
2.4k 41 53 70

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x535
x496

asked: May 17 '10 at 12:34 AM

Seen: 1637 times

Last Updated: May 17 '10 at 12:34 AM