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. Dismiss Notice

How to unsuppressed Script ? / Error message / any coloration?

Discussion in 'Scripting' started by yukihi, May 28, 2016.

  1. yukihi

    yukihi

    Joined:
    May 28, 2016
    Posts:
    5
    Hi, I'm new to Unity.

    I'm working on one of the first tutorials on Unity. I got this message (image 1). Anyone please let me know how to fix this?
    Also, the script I created is suppressed (image 2.) And the object is not following what script says when I hit "Play". Is there any coloration between the fact the script (seems to be) is suppressed and not the object playing? In that case, how do I unsuppressed the script?

    Thank you!


    image 1.

    Screen Shot 2016-05-28 at 2.03.20 PM.png

    image 2.
    Screen Shot 2016-05-28 at 1.56.00 PM.png
     
  2. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Image 2 is normal. The "script" field is always greyed out in the inspector for MonoBehaviours. It's just there so you can double click it to open the file if you want.

    Image 1 I've never seen before but it looks like the kind of thing that can happen if you're trying to open the script in MonoDevelop while Unity's still building it or your antivirus scanner is scanning the files. Try just exiting MonoDevelop and then waiting a second and then double click the script again in Unity and see if it goes away.
     
    yukihi likes this.
  3. yukihi

    yukihi

    Joined:
    May 28, 2016
    Posts:
    5
    Thanks makeshiftwings.
    For the answer image 2. Ok, thanks.

    For the answer image1, I somehow got rid of the error message. I know the script is attache to the object (player). I also closed the project and re-opened it but the object doesn't move...
     
  4. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    You'd have to post the actual script for us to see what the problem might be. It's covered up by the error window in your image.
     
    yukihi likes this.
  5. yukihi

    yukihi

    Joined:
    May 28, 2016
    Posts:
    5
    makeshiftwings, here Thanks!
    Screen Shot 2016-05-28 at 2.55.01 PM.png
     
  6. yukihi

    yukihi

    Joined:
    May 28, 2016
    Posts:
    5

    makeshiftwings, and this, for just in case,

    Screen Shot 2016-05-28 at 2.56.52 PM.png
     
  7. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    That looks correct. Just to be clear: you have to enter Play mode, then use the arrow keys to move the ball around. Make sure no boxes are checked in the "Constraints" section of the Rigidbody.
     
    yukihi likes this.
  8. yukihi

    yukihi

    Joined:
    May 28, 2016
    Posts:
    5
    makeshiftwings, Thanks! My computer started to freaking out (MBP) and I had to force quite it. Then I re-opened it and now it works...!

    At some points, in the past few hours, errors such as image 1 popped up (with different reasons) Somehow by pressing many keys, I deleted them... I also uninstalled and re-downloaded/installed Unity hoping this error will disappear... but didn't solve it. Oh well.

    But thank you so much, makeshiftwings!