How-to create a C-Sharp (C#) script in Unity3D

This is a very short how-to to show the creation of a new C-Sharp (C#) script in Unity3D

  1. Open Unity3D
  2. Select the project tab
  3. Select ‘Assets’
  4. In the middle pane right click and select ‘Create/C# script’
  5. Name the script to your liking (eg. Test1)
  6. Double click the script to open the MonoDevelop editor

To use this script you can do the following

  1. Select a GameObject in the ‘Hierarchy’ area
  2. Go to the inspector
  3. Hit the button ‘Add component’
  4. Type the name of your new script (eg.: Test1)
    • The script shows up and you can select it

That’s it

Shortcut

There is also a quicker way to do that:

  1. Select a GameObject
  2. Hit ‘Add component’
  3. Type ‘New ‘ and select ‘New Script’
  4. The wizard guides you through to create a new script

No Responses

Leave a Reply