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
1
Question by Thardus · Nov 06, 2011 at 10:44 AM · crashaddcomponent

AddComponent is making Unity crash

timer = new GameObject("moveTimer"); timer.AddComponent(MovementTimer);

Hi, I'm using the code above to add a script to a new GameObject. but the "addcomponent" line seems to make Unity freeze during runtime. I really don't have a clue what could be causing this as there is no error message. Has this ever happened to anyone before?

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 Bunny83 · Nov 06, 2011 at 11:35 AM 0
Share

It would help to see the code of "$$anonymous$$ovementTimer". I guess you created an infinite loop in that script which will of course crash Unity.

avatar image syclamoth · Nov 06, 2011 at 11:46 AM 0
Share

If there's something in the Start of that script, then yeah it'd do that.

avatar image Jehos · Nov 07, 2011 at 10:49 AM 0
Share

Please mark this as answered! :)

avatar image syclamoth · Nov 07, 2011 at 10:57 AM 0
Share

@Jehos, that's cheating.

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Thardus · Nov 06, 2011 at 09:15 PM

Thanks guys, I just realized I had an infinite loop in my start method for MovementTimer

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 Bunny83 · Nov 10, 2011 at 12:31 PM 0
Share

converted to Answer and marked as correct one.

avatar image
0

Answer by Jehos · Nov 07, 2011 at 11:16 AM

I didn't mean to mark my answer as the correct one, if that's what you mean. I merely mean to mark this question as answered overall.

I (and probably others), browse in here a few times and in a very limited time a day. I try to help with whatever I can, the same way others have (and do) help me constantly.

When I come here, I filter by unanswered questions and I've been finding a lot of questions already answered that are not marked as answered, and it's a waste of valuable time that could get someone unstuck with a problem.

I could care less about having answered questions or badges or any other stuff. I do this to give back to a community that has constantly helped me selflessly.

Comment
Add comment · Show 4 · 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 CHPedersen · Nov 07, 2011 at 11:43 AM 1
Share

Then add a comment that tells one of the other commenters to convert his comment to an answer, that may then be marked as the right answer. :P

avatar image Jehos · Nov 07, 2011 at 01:36 PM 0
Share

You're right.

I didn't know the difference between comment and answer.

I though comment was like a quick reply and answer was like a formatted one. I see now this forum has this karma useless thing implemented.

It's my first time in here.

avatar image CHPedersen · Nov 07, 2011 at 01:55 PM 0
Share

Well... You're kind of right. An answer IS a more formatted reply. The problem is that the powers that be wanted a Q&A board with searchable questions and attached answers, but have seen fit to implement something that looks like a forum and is therefore treated like a forum by its users. And so, desperate for precious order, the powers that be tirelessly work to inflict Q&A behavior on the users ins$$anonymous$$d of designing the board so that it follows naturally. ;) Wonderful, don't you think?

$$anonymous$$arma isn't entirely useless. It bestows certain moderator powers on the users so the more advanced ones can help improve the board.

avatar image Jehos · Nov 07, 2011 at 02:09 PM 0
Share

I absolutely agree.

Also, purely in terms of design and pragmatic use of the board, it's much harder to find the small "add comment" button than the big "Post your answer" :) (for me at least, as a new user).

I just answered in another Q&A forum and did the same thing. But I learned! Edited and answered as comment.

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

6 People are following this question.

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

Related Questions

5.0.0b9 Addcomponent cause a crash 1 Answer

Constant crash in Unity - 'too many threads' 2 Answers

Resource folder doesn't build. Why is it empty? 1 Answer

Unity 4.3.1 and MonoDevelop 4.0.1 debugging Freezes Unity 5 Answers

Crash report xcode organizer symbol 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