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 fisionchips · Jul 12, 2012 at 09:33 AM · gameobjectcolliderdestroyinvisible

Destroy gameObject leaves behind collider?

I am using a Sphere collider as a trigger to prompt the player to interact with an object. The parent object has a script to handle the destroy function and several child objects - neither the parent or the child objects have colliders, they have AudioSources, but no Rigidbody. The Sphere collider is a child object and has a script attached. That script instructs the parent script to destroy itself and this is working. Sure enough, the object disappears from the scene when the right conditions are met.

The problem is, it is leaving behind something invisible which is acting as a collider so the player character can't walk into the (now) empty space where the object formerly existed.

Can anyone give me an idea what is happening here?

The code for the removal function is as follows:

 public class FFS_RemoveMe : MonoBehaviour {
  public float removeTime = 0.0f;
  public AudioClip briiing;
  public GUIText displayText;
  // Use this for initialization
  void Start () {
  
  
  
  }
  public void destroyMe(){
 
  gameObject.audio.PlayOneShot(briiing);
  Destroy (gameObject, removeTime); 
  
  }
 
     void Destroy(){
  
  }
 }

The calling script is:

faulty.SendMessage("destroyMe");

faulty is a public gameObject type which is set to the parent gameObject in the Inspector.

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
0

Answer by robeth · Jul 12, 2012 at 11:08 AM

Strange. Have you tried to inspect hierarchy & inspector tab to ensure the game object fully disappeared? Check whether there is an object has collider in that "empty space"

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 fisionchips · Jul 12, 2012 at 11:49 AM 0
Share

Thanks for the tip - I checked and the object disappears from the Hierarchy but still there is something blocking the way.

avatar image fisionchips · Jul 12, 2012 at 11:54 AM 0
Share

I also just moved the object in the scene just in case there was another object interfering: same result.

avatar image robeth · Jul 12, 2012 at 11:56 AM 0
Share

how about the other game object? maybe they have collider filling that empty space. if it isn't, i don't have any other clue :|

avatar image fisionchips · Jul 12, 2012 at 12:03 PM 0
Share

Thanks Robeth, I just checked that, I moved the game object to a completely different location and it still behaved the same way. I am going to check the player characters locomotion scripts to see if there is anything cuckoo there.

avatar image fisionchips · Jul 12, 2012 at 03:04 PM 0
Share

We have managed to fix it - there was a texture associated with the script which had a collider but was not parented to the actual object we were destroying. It was set to not be rendered after use which was why it was invisible but still present. Sorry for the headache this gave anyone....

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

using Contains(gameObject) to find and destroy a gameObject from a list 2 Answers

Destroying gameobject after its been cloned 1 Answer

My bullets destroys Objects without it hitting it. 1 Answer

Create Object when other Object hits ground. 1 Answer

need help to destroy game object 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