Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
2
Question by ASH247 · Sep 09, 2014 at 05:57 AM · bug

User Scripts not showing in "Add component - scripts"

I have been following the excellent SpaceShooter tutorial and came across what seems to be a bug. When you create a script directly in the scripts folder (namely DestroybyTime) and try and attach it to a prefab object using "Add component - scripts" it isn't listed but it is in the scripts folder. Upon further investigation none of the scripts I have created show in this list - only the presupplied scripts that I downloaded from the asset store. Is this a bug or just me - all the scripts show up if you search for "all scripts" in the explorer. Thanks

Comment
Add comment · Show 4
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 Landern · Sep 09, 2014 at 06:11 AM 0
Share

Do any of your scripts have errors?

avatar image Kiwasi · Sep 09, 2014 at 07:14 AM 0
Share

Does your script inherit from $$anonymous$$onoBehaviour?

avatar image Dave29483 · Sep 09, 2014 at 07:46 AM 0
Share

Does the script file name match the class name?

avatar image PAHeartBeat · Sep 11, 2014 at 12:04 PM 0
Share

if that script is C# then it should must match name of file and class name, for JS file name is the bydefalut class name and inherteed from monobehaviour

6 Replies

· Add your reply
  • Sort: 
avatar image
8

Answer by FenrisWolf · May 08, 2015 at 12:11 PM

@ASH247 compare your script to the done_DestroyByTime script in the done folder under scripts. I was having the same problem until I realized I had forgotten to change

public class NewBehaviourScript : MonoBehaviour

to

public class DestroyByTime : MonoBehaviour

Hope that helps!

Fen

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 superwholock · Jun 18, 2017 at 03:34 AM 0
Share

you ever see that meme where somebody has the exact same problem as you, but the question was posted years ago and nobody posted an answer?

I'm glad that didn't happen this time. Thank you for your annoyingly easy, yet hard to find fix!

avatar image
2

Answer by TimK_personal · Jun 26, 2015 at 07:05 PM

Another thing that can cause this problem: a typo in your file name such that the name of the file does not match the class' type.

Comment
Add comment · 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
1

Answer by Jedah · Dec 22, 2016 at 06:32 PM

I know this is old, but is the first link Google shows when searching for this specific problem. I had the same problem when following another tutorial, and the solution is quite simple once you know the mistake you were having... when following a tutorial on scripting it seems that the authors are forgetting one step, after you write the script, you have to go to the menu and press "build all" (F8 as a shotcut) After that step, the script should definetly show on the components :) I hope this answer helps another newbie like me in the future

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
0

Answer by thiagolrlopes · Aug 12, 2017 at 09:20 AM

Thanks man, i was about to smash my head on the wall for not finding the problem... I was doing another tutorial but same problem it was the "NewBehaviourScript : MonoBehaviour" to the proper name.

Comment
Add comment · 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
0

Answer by esverin · Aug 25, 2017 at 01:16 PM

A bit late on this one, but I stumbled across this thread whilst doing some searching on my own!

My solution was that i was trying to access another script which relied on other references/libraries. I resolved this by just adding the ones the other one was using by entering "using unityEngine.(librarygoeshere);"

Hope my answer did any help to others scowering the same threads as i did!

Comment
Add comment · 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
  • 1
  • 2
  • ›

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

14 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

Related Questions

Getting script from another script bug 1 Answer

2 Bugs in my game: mouse control takes some time to load and Menu not working. 0 Answers

Distance betwen two objects.Error,bug,etc. 2 Answers

Is there any flying bug scripts out there? 1 Answer

yeild WaitForSeconds Bugged 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