• 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
2
Question by zeropoint · Jul 21, 2011 at 09:42 AM · meshfilter

Removing MeshFilter!!

Hi,

For any game-object in Unity, if i remove the 'MeshFilter' component, the following things make me wonder!!:

  1. No mesh data at runtime -- this is fine

  2. Still draws the object -- this is bizzare since there's no 'MeshFilter' component having the corresponding mesh!!

  3. In conformance with #2, stats window shows no change after removing 'MeshFilter'

Does mesh data remains with Unity runtime even after removing the 'MeshFilter' component at runtime?

Comment
Add comment · Show 8
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 · Jul 21, 2011 at 09:47 AM 0
Share

How are you removing the component? Are you using Destroy, like in this example?

http://unity3d.com/support/documentation/ScriptReference/Object.Destroy.html?from=GameObject

avatar image zeropoint · Jul 21, 2011 at 10:18 AM 0
Share

Yes, i am using 'Destroy' method of Object class.

avatar image CHPedersen · Jul 21, 2011 at 10:40 AM 0
Share

Then I have no idea, but I find this very interesting, too. I hope someone more experienced can shed some light on what's going on. +1!

avatar image Graham-Dunnett ♦♦ · Jul 21, 2011 at 11:01 AM 3
Share

Isn't the $$anonymous$$eshRenderer responsible for rendering the mesh? It might have a cache DX or OpenGL copy of the mesh and be happily submitting it for rendering each frame. What is it that you are trying to do?

avatar image asafsitner · Jul 21, 2011 at 01:02 PM 0
Share

It works fine for me. When you look at the object on the scene view, does the mesh renderer component still show in the inspector?

Show more comments

1 Reply

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

Answer by Eric5h5 · Jul 22, 2011 at 05:35 AM

You need the MeshFilter in order to specify what mesh to render. Without a MeshFilter, you won't see anything. Yes, you can delete the component at runtime and it will still render, at least for a while (probably cached like Graham Dunnett said). I wouldn't rely on that, though, and you don't gain anything, so there's no reason to do it. Try this: put an object in the scene, delete the MeshFilter component, save the scene, then reload it. See, now the object is invisible, because it doesn't know what to render.

Comment
Add comment · Show 2 · 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 zeropoint · Jul 22, 2011 at 08:56 AM -1
Share

You are right Erich5h5 that $$anonymous$$eshFilter is a must for rendering, but was just not sure of caching. Anyways, deleting doesn't account for reduction in vertex-count or anything expected; so it follows that caching would be going on most probably, and hence deleting is not a good idea anymore :)

Thanks everyone for your inputs :)

avatar image Eric5h5 · Jul 22, 2011 at 09:04 AM 1
Share

Don't post comments as answers please.

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

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

Copying a mesh filter component through script. 0 Answers

TransformPoint trouble 1 Answer

Create a 3D trail renderer like Hawk eye simulation 1 Answer

Mesh Filter Component: "meshname" replaced with "meshname Instance" 1 Answer

Why is my script constructed mesh rotating the wrong way 0 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