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
0
Question by Dataforge · Sep 02, 2013 at 02:15 AM · physicsobjectparticlesdestroyshuriken

Is there a way to destroy an object besides Object.Destroy?

Objects in my game keep randomly destroying themselves when I don't want them to. I've commented out the only instance of Object.Destroy in all my game scripts, and it still happens.

So far I've been unable to find any conditions that make an object more likely to destroy itself.

So, does anything besides Object.Destroy destroy an object, something I'm missing when looking for the cause of this bug?

Further information:

  • Unity version 4.0.1f2.

  • All objects destroyed are instantiated.

  • The game involved gravitational physics. It's possible, but unlikely, that I've made an error in calculations and set an object's position to NaN or infinity.

  • The game involves up to 1000 Shuriken particles, and gravity physics on those particles.

  • Particles are almost always present when an object destroys itself, though this could be a coincidence.

Comment
Add comment · Show 5
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 TSRajesh · Sep 02, 2013 at 02:40 AM 0
Share
  • For particles, Depending on energy, it will get destroyed by itself..

  • If you have set teh object's position to infinity or something, It should still show up in the Hierarcy panel..Are you sure it is destroyed??

avatar image Dataforge · Sep 02, 2013 at 02:47 AM 0
Share
  • It's game objects that are getting destroyed, not just particles.

  • I'm absolutely sure it's destroyed. It disappears from the hierarchy panel, and scripts attempting to access the object come up with an error.

avatar image meat5000 ♦ · Sep 02, 2013 at 10:17 AM 0
Share

Also check they aren't beco$$anonymous$$g children, perhaps. Sometimes they can be hard to spot in the hierarchy if the parented gameobject already has a child. In some circumstances childing an object will affect it's scale so it will also be hard to find visually.

avatar image DuckOfDoom · Sep 02, 2013 at 10:53 AM 0
Share

You can try using Debug.Log in OnDestroy() function and than deduce from stack trace where from the object got destroyed. Not sure if this will work.

Or insert Debug.Break() and check where your object is.

avatar image Dataforge · Sep 03, 2013 at 10:15 AM 0
Share

@Jamora That seems to have fixed it. Thank you.

1 Reply

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

Answer by Jamora · Sep 02, 2013 at 10:02 AM

This question had a similar problem. You wouldn't happen to have any auto destroy flags on? Trail renderers have one, maybe your particle system does too...

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

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

20 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

Related Questions

How to destroy live particle in Shuriken 1 Answer

How to destroy / hide a single particle? 2 Answers

Collision with a coin 0 Answers

How do I enable an object when it is destroyed? 2 Answers

Turn On & Off Shuriken particle system? 2 Answers


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