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

GUI Skin Script Not Working

Discussion in 'Immediate Mode GUI (IMGUI)' started by Abel_Graham, May 3, 2014.

  1. Abel_Graham

    Abel_Graham

    Joined:
    May 3, 2014
    Posts:
    10
    I have a problem with my simple Unity GUI skin script and I can't seem to figure out why, here is the script (in Javascript).
    Code (csharp):
    1. #pragma strict
    2.  
    3. var Skin : GUISkin;
    4.  
    5. function OnGUI()
    6. {
    7.     GUI.skin = Skin;
    8. }
    Here is the error.
    Code (csharp):
    1. Assets/GUI/GUISkin.js(7,16): BCE0022: Cannot convert 'GUISkin' to 'UnityEngine.GUISkin'.
    2.  
    Please help if you can.
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,398
    It's a good idea not to use Unity class names for your own scripts.

    --Eric
     
  3. Abel_Graham

    Abel_Graham

    Joined:
    May 3, 2014
    Posts:
    10
    I'm not sure what you mean by that.
     
  4. Abel_Graham

    Abel_Graham

    Joined:
    May 3, 2014
    Posts:
    10
    Never mind, I figured out what it was, thanks.