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 LordGunther · Jan 04, 2014 at 05:34 AM · gameobjecthierarchydeletespace shooterboundary

Game object deleted from scene but not from hierarchy?

I'm currently working on the Space Shooter tutorials, I've just completed the boundary tutorial and I'm noticing a difference between the results. In my game, the Bolt is deleted from the scene once it exits the boundary but it still shows up in the hierarchy. (I've tested this by removing my code, watching the bolt continue in the scene, and then putting my code back in to watch the bolt get deleted as it exits, so the code works and is exactly what is shown in the tutorial) Perchance is there a setting for the hierarchy that shows objects even after they have been deleted, or is my problem something much more problematic (i.e. not actually deleted)?

Comment
Add comment
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 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by 13dnizinski · Jan 04, 2014 at 05:58 AM

I would venture to guess that you didn't really delete the object? It sounds a bit like you deleted the mesh from the GameObject, but the GameObject itself is still there?

Comment
Add comment · Show 5 · 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 LordGunther · Jan 04, 2014 at 06:30 AM 0
Share

This is my exact code, sadly I cant get the spacing right on this comment editor:

using UnityEngine; using System.Collections;

public class DestroyByBoundary : $$anonymous$$onoBehaviour { void OnTriggerExit(Collider other) { Destroy(other.gameObject); } }

avatar image Josh707 · Jan 04, 2014 at 09:04 AM 2
Share

Does the object that is being destroyed have a parent? Try destroying the top-most object:

 Destroy(other.transform.root.gameObject);
avatar image Bunny83 · Jan 04, 2014 at 10:16 AM 0
Share

That's most likely what happens here. The hierarchy is the scene. If something is shown in the hierarchy it is in the scene, even when it's not visible.

avatar image LordGunther · Jan 05, 2014 at 02:43 AM 0
Share

$$anonymous$$y issue is fixed, thanks guys! It turns out that the capsule collider on the bolt was in the child rather than the parent (I hadn't even remembered that there was a child at first). I've moved the collider to the correct object and everything is working flawlessly now.

avatar image samchiefy · Mar 18, 2015 at 10:58 PM 0
Share

Had exactly the same issue, moving collider from child object fixed for me also. Thanks for that!

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

22 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

Related Questions

Can't remove GameObject from scene in editor (Not appear in heirarchy, not selectable, Ghost object) 2 Answers

How to keep a GameObject inside a collider? 3 Answers

My object wont move when I use transform.translate. 2 Answers

How to add an asset to a script-enabled public game object? 1 Answer

Deleting GameObjects 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