Search Unity

Creating a new script file with a custom name..

Discussion in 'Scripting' started by FuzzyMonkeyMan, Apr 4, 2011.

  1. FuzzyMonkeyMan

    FuzzyMonkeyMan

    Joined:
    Apr 4, 2011
    Posts:
    5
    Hi-

    I am trying to create a new script file in a blank project in Unity..I can create the script but I can't name it.

    The steps are: Click Assets->Create->C Sharp Script.

    This creates new scripts called "NewBehaviourScript", "NewBehaviourScript 1", NewBehaviourScript 2", etc.

    If I click on the script name (NewBehaviourScript 1 for example), I can type in a new name for the script...when I change focus away from the text field, the name reverts to whatever it was by default (NewBehaviourScript 1 for example).

    --------------------------
    So, I can create new scripts but I have no way to rename them. I tried doing this with a fresh project to make sure I'm not crazy, the steps are very easy to re-produce (create new project, create a new c# script, try renaming it)..

    I can manually copy a *.cs file to a different folder, rename and edit it, and then import it into Unity, but that seems like overkill.

    Surely there is some way I can create a named script in Unity, I'm assuming this is such a basic operation I'm missing something simple.

    Thanks in advance for any help, I've looked through the docs and tried creating several new scripts, I just don't see how this feature works.
     

    Attached Files:

  2. 2dfxman1

    2dfxman1

    Joined:
    Oct 6, 2010
    Posts:
    1,065
    When you change name you need to press enter
     
  3. FuzzyMonkeyMan

    FuzzyMonkeyMan

    Joined:
    Apr 4, 2011
    Posts:
    5