Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by karl_ · May 17, 2010 at 12:34 AM · update

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).

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by karl_ · May 17, 2010 at 01:16 AM

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.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image tayyab43 · Mar 02, 2014 at 02:39 PM 0
Share

i'm having the same problem look:

 var bulletTracePrefab : GameObject;
 var rate : float = 8.0;
 var velocity : Vector3;
 var on : boolean = false;
 var accuracy : float = 1.0; //1.0 to 0.0;
 public var Clip : int = 36;
 private var nextbulletTraceTime : float;
 var ammo :GUIText;
 var TotalAmmo: int=240;
 var IsSentry = false; 
 var bulletsLeft : int;
 var AmmoLeft : int;
 
 function Update () { 
     if (on){
         if(Time.time > nextbulletTraceTime){
             rate = $$anonymous$$athf.$$anonymous$$ax(rate, 1.0);
             nextbulletTraceTime = Time.time + (1.0 / rate);
             var newBulletTrace : GameObject = Instantiate(bulletTracePrefab,transform.position,transform.rotation);
         if (IsSentry==false)
         {
             Clip = Clip - 1;
             if ((Clip==0)||(Input.Get$$anonymous$$eyDown($$anonymous$$eyCode.R)))
             {
                 AmmoLeft=36-Clip;
                 TotalAmmo-=AmmoLeft;
                 Clip=36;
             }
             
         }
             audio.Play();
             var bulletVelocity : Vector3 = newBulletTrace.GetComponent("bulletTrace").velocity;
             var badAim : float = (1-accuracy);
             badAim *= newBulletTrace.GetComponent("bulletTrace").bulletSpeed * 0.05;
             bulletVelocity += newBulletTrace.transform.right * Random.Range(-badAim,badAim);
             bulletVelocity += newBulletTrace.transform.up * Random.Range(-badAim,badAim);
             newBulletTrace.GetComponent("bulletTrace").velocity = bulletVelocity;
             
         
         }
     }
 
 }
 function OnGUI()
 {
 GUI.Label (Rect (10, 10, 100, 20), ""+Clip+"/"+TotalAmmo);    
 
 }

 
avatar image
0

Answer by ref onyos · Jun 27, 2013 at 02:35 PM

You should try going to Edit>Preferences>External Then from there select your script modifier program. If that doesn't work then I don't know what to tell you :-(

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

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

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Coroutine - events not working 2 Answers

How to detect empty slot and spawn gameobject there? 1 Answer

Code isn't Recursive in update? 2 Answers

Expecting ( found Update (Javascript) 1 Answer

How do you update code/stage/screen at runtime? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges