Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 vbbartlett · Dec 11, 2012 at 06:17 PM · meshprefabmaterialdeleted

Prefab Materials and Meshes being deleted, How can I stop this

In the editor I have created prefabs (A) in a resource directory, in code I am loading them, then instantiating a copy of it(A'), and creating(instantiating) a pool (array) of gameObjects (B), finally I am setting the pool items' (B) material and mesh to that of A'.

This all works great the first time I run, but as soon as I stop, it appears that the clean up deletes (A)'s material and mesh. Why and how can I prevent this from happening to a prefab in the project?

Again Project has prefab A, I load A and instance it to A' then create B's and assign B's material/mesh to A'

Comment
Add comment · Show 3
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 vbbartlett · Dec 11, 2012 at 04:13 PM 0
Share

Background, this is for data driven loads so I can deter$$anonymous$$e at runtime which prefab I want to create. Second I want a pool of gameobjects to draw from because I actually am loading say 3 different prefabs and when I need a gameobject I am getting one from the pool and then setting its mesh/material to one of the 3 prefabs I have loaded. This gives dynamic loading without hopefully large memory overhead.

But currently has the drawback of screwing up the actual real prefab.

avatar image vbbartlett · Dec 11, 2012 at 04:18 PM 0
Share

example debris, i want a pool of debris gameobjects, so I create 100. But I don't want the debris to be the same display. So I load 3 gameobjects with textures of debris. Thus procedurally I deter$$anonymous$$e which of the 3 textures I need to use, and assign it to the debris pool item I have received. I should have a highwater mark for memory with the 100 pool items and the 3 differences.

(just picked numbers out for the example, I have much high numbers intended and highwater marking the memory usage is critical)

avatar image cassius · Dec 11, 2012 at 06:41 PM 0
Share

Just out of curiosity are you creating a new material when updating A's materials or simply updating the current material it uses?

1 Reply

· Add your reply
  • Sort: 
avatar image
-1

Answer by theonciest · Nov 13, 2021 at 09:48 PM

such a useless system, it's been 9 years and this person doesn't get ANY freaking help.

Wonderful

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 Bunny83 · Nov 13, 2021 at 11:12 PM 0
Share

The op hasn't been online for over 6 years. Also the question is extremely ambigous and it's not really clear what he actually did. So why did you bump this ancient question with an answer that does not answer the question but represents a rant? Do you consider your own actions helpful?


cassuis did ask back and did not get any reply. Also Unity has heavily changed since 2012. It has a completely different prefab system now. So even if the exact circumstances of the question had been cleared up and someone had written an answer, it would be heavily outdated by now.

avatar image theonciest Bunny83 · Nov 15, 2021 at 08:39 PM 0
Share

I had a similar issue to this. My prefab kept deleting my mesh, and turns out the fbx itself had some issues on it. Had to reset xforms in 3ds max and collapse the stack. All is fixed, but it's stumbling across these types of threads when searching for a fix. Either there is no solution so you have to create a work around yourself, or there are dead threads like this with no answer.

My favorite are the ones where people ask for their specs, and then they reply with the specs and it is ignored for 8 years.

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

12 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

Related Questions

Different prefabs with same mesh but different textures(materials). 1 Answer

Apply new complex fbx to saved prefab 0 Answers

How can you duplicat folders and not share old dependencies? 1 Answer

Generated meshes/materials cannot be made into prefabs? 1 Answer

Possible Unity Glitch. A few lines of code erasing prefab data. 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