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 Michel Verheughe · Mar 29, 2013 at 08:35 AM · gameobjectdelete

Deleting objects

Please, help me because I am loosing my mind! I am told I have a memory leak leading to a Fatal Error in Flash. I try now to localize this by removing, one by one, the objects of my scene. I delete them in the Hierarchy menu and save it as a new scene. I then compile it as Flash and ... the objects are still there! I even tried it as Unity Web Player and they are still there! They are gone in the Editor, but still there once compiled.

... did I miss something?

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 sparkzbarca · Mar 29, 2013 at 09:56 AM 0
Share

what language are you writing in? this is VERY bizarre, as I understand it both C# and javascript are garbage collection languages. That makes a memory leak all but impossible.

avatar image Michel Verheughe · Mar 29, 2013 at 12:37 PM 0
Share

I write JavaScript but ... the the memory leak, I can try to debug. What I don't understand is, when I delete objects from the Hierarchy menu (but not from the Project one) then run the Editor, those objects are gone. But when I compile the scene as a Flash or Unity Web Player, ... they are still there! It makes debugging by eli$$anonymous$$ation impossible! I don't understand!

avatar image fafase · Mar 29, 2013 at 03:33 PM 0
Share

Did you save the scene after removing them all? As a side note, it is not Javascript or C# which use garbage collection, it is the .Net framework. C# or Js are just languages using the whole runtime thing from .NET. But this is all secondary:).

avatar image Michel Verheughe · Mar 29, 2013 at 04:56 PM 0
Share

Yes, I saved it. I started Unity3D, I saved a new scene called, Test, then I started deleting objects from the Hierarchy menu then I started it in the Editor, just to make sure I didn't delete scripts that exchanged data, and with no scripting error message, I went on to compile as a Flash object to test it as I have a Flash debugger on I$$anonymous$$ To my surprised, those objects (actually, two ships sailing at sea) were still there, although not when I animated in the Editor. I then saved again, left Unity3D (I have both Unity3D Pro and Flash Pro) and even restarted my computer! I am 65 years old and although new to Unity, I have programmed since 1979 and I have seen many strange things! Anyway, starting again, compiling for Flash, again, noticing that the file, with a new name, has the same size as the old file, I tried and still, it compiles with everything in the Assets folder, even though they are not in the Hierarchy menu and not visible in the Editor.

2 Replies

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

Answer by sparkzbarca · Mar 29, 2013 at 01:22 PM

well anything in the Resources folder is compiled into the project.

I mean if it's in your project folder it's part of the compilation you need to go into windows explorer actually and create a new temporary folder higher up so it's outside of the unity project folder all together then move assets into that slowly.

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 Michel Verheughe · Mar 29, 2013 at 03:01 PM 0
Share

Does it? ... I am flabbergasted! Isn't the idea that you have a project with multiple scenes? Are all the objects in the project embedded in all the scenes then? It doesn't make sense. In any case, why have those objects disappeared when I watch it in the Editor yet, they come back when compiled as a Flash object? Is it made to confuse on purpose?

Of course, I can make a duplicate of the entire project folder in Windows, then remove entirely those objects but then ... it creates a lot of unnecessary folders and take much memory space. Why can't we just activate or deactivate an object, a property or a script by simply deselect it in the Hierarchy window?

avatar image fafase · Mar 30, 2013 at 02:47 PM 0
Share

http://answers.unity3d.com/questions/57909/find-unused-assets-in-project.html maybe you should look there

avatar image sparkzbarca · Mar 30, 2013 at 03:48 PM 0
Share

Resources is a sepcial folder. Check out Resources on the unity docs. Essentially the purpose of Resources is to allow for dynamic stuff. If you want to apply a shader to an object, but that object doesnt yet exist, and that object isn't even like a prefab your going to spawn later but is in fact an object not yet created. perhaps your going to weld prefabs together Borderlands style or something but basically at some point your going to create a completely new GameObject on the fly that doesn't currently exist, but you would like to do stuff to it that does exist. That's why Resources exists. You can grab scripts and textures and all that good stuff out of it to apply later to stuff that doesn't yet exist.

That's why it can end up lurking in a scene it's not in. It's not loaded into RA$$anonymous$$ but it's waiting for you to pull bits of into the scene or push bits of the scene out to it.

avatar image Michel Verheughe · Mar 30, 2013 at 09:09 PM 0
Share

@sparkzbarca: I am sorry but I don't find any "Resources" folder in my Unity3D project. Could you detail?

@fafase: I did the test from that link: found the Editor.log file and read that, indeed, it includes the objects and scripts that I see in the compiled file, but that are no longer existing in the scene, as view from the Hierarchy window. The are still there in the Project window / folder because contrary to the other poster who simply wants a "clean-up" I know exactly what all the files in my project do and I want only to toggle on and off, in order to debug for memory leak. But from what I read from the link you gave me, what I experience should not happen: A scene that doesn't contain an object, should not display it. It doesn't make sense!

I can assure you that when I press the Play button in the Editor, those objects don't show and yet, when compiled as Flash, they are there! It's insane!

avatar image
1

Answer by Michel Verheughe · Mar 31, 2013 at 02:28 PM

Sorry everyone! I found my mistake: I deleted objects, etc. then saved the scene under another name. Then I used "Build and Run" to test it as a Flash file ... but when you do that, you still have the previous scene as the selected one to build! And that is why I saw two different things: what the Editor shows and what the Flash build shows!

A silly error but ... I knew something was wrong and it must be my error! ;-)

Cheers,

Michel

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 ocimum · Oct 21, 2015 at 02:00 PM 0
Share

Nice bug! :)

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

13 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

Related Questions

[SOLVED] How I can detect deleted gameobject 1 Answer

create a destroyer for 2d infinite runner game objects. 2 Answers

deleting self-gameobject,deleting self-gameobject 0 Answers

If I delete an object stored in an array, will it shorten the array or leave an index position with a null value? 1 Answer

using Contains(gameObject) to find and destroy a gameObject from a list 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