Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by ThunderStrikeBlue · Jun 28, 2016 at 04:51 PM · c#editorbugtext file

Got a weird editor issue with C# scripts: They won't open correctly

Hey,

I'm not sure if this is a common issue of just something with my computer, but I am using Unity 5.3.4 and whenever I create a new C# script, the little icon next to the name is blank white and has no C# icon on it. In addition to this, these new scripts don't open in Visual Studio Community and open in Notepad only. At the end of the scripts' file directory name, instead of NewBehaviourScript.cs for example, they say NewBehaviourScript.cs - Copy. Does anyone know how to fix this annoying bug? Or have I done something by accident that caused this?

Comment
Add comment · Show 1
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 ThunderStrikeBlue · Jun 28, 2016 at 05:03 PM 0
Share

Just so you know, this may be a result of me changing the script templates because the editor is asking for C:\ProgramFiles\Unity\Editor\Data\Resources\ScriptTemplates\81 - C# Script NewBehaviourScript.cs - Copy.txt ins$$anonymous$$d of a non-copy...

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by btmedia14 · Jun 29, 2016 at 02:27 AM

You've kind of answered your own question.

There is a numbering and naming convention used for the template files in directory C:\ProgramFiles\Unity\Editor\Data\Resources\ScriptTemplates\

In your case, template 81 used for C# scripts has the "-Copy" suffix and so each new script file created will have that suffix attached. As such, it will not be recognised as a C# file, which needs to end as filetype .cs.

1) Within that template directory, ensure the template is named as:

81-C# Script-NewBehaviourScript.cs.txt

This will correct for any scripts going forward.

2) For your existing project scripts, locate the directory under Assets containing the generated script files and rename any containing the suffix "-Copy" by removing that suffix and simply having ".cs" as the filetype.

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 ThunderStrikeBlue · Jun 29, 2016 at 09:46 AM 0
Share

Thanks for helping me out. I'm new to Unity and I was looking for a way to change my script templates.

I managed to fix it a few hours later by changing the end of the file to NewBehavioursScript.cs.txt because it had renamed itself to a .cs file when I edited it. A simple restart of the engine realigned the file with the engine. Thanks for helping though.

And to cap things off, I'm the king of answering my own questions without noticing :) Thanks for the help and now I can get back to coding my FPS in peace.

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

175 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Camera Preview is empty 5 Answers

Unity Mac version 5.2.3f1 crash every time after 5 minutes 0 Answers

How to save text to file with the separated lines 0 Answers

how can i use my phone's camera as a webcam and let unity recognize it as a connected webcam? 0 Answers

Button disappearing when I start playmode 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