Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 SP Designs · Jun 18, 2016 at 05:44 AM · prefabsmaterialsinstances

Changing the Material of an instance of a prefab only!

Hello there! I am making a 3D game and i have a few floating island prefabs.I drag each time i want to create a new island one of the available prefabs in the hierarchy to add some props on it and then make the new finsihed island a prefab.I've recently noticed that, when i add a new empty floating island and change let's say it's material's color, every single other instance of that prefab including the finished island(the one with the props on) changes material color and that's a huge pain for me since it doesn't allow me to continue with my game.I tried my best to explain this issue and sorry if it's not very understandable!So my question is, can i change the material of an instance of the island prefab without changing every other's material?Sorry if this is a dumb question btw.

Comment
Add comment · Show 2
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 mwnDK1402 · Jun 18, 2016 at 02:55 PM 0
Share

Can you post an image of the prefab?

avatar image SP Designs mwnDK1402 · Jun 18, 2016 at 07:08 PM 0
Share

alt text

This is one of the prefabs for example(the one with the props on it) and imagine the same one without the props,just an empty island prefab.

unity-2016-06-06-23-18-26-40.jpg (461.1 kB)

2 Replies

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

Answer by Sagi02 · Jun 18, 2016 at 07:12 PM

You just have to create a different material for each different island: when you change a material, all GameObjects with this material will change even if they are not from the same prefab. Remember that a material is passed by reference in the editor and not by value.

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 SP Designs · Jun 18, 2016 at 09:22 PM 0
Share

So if i delete the current material of a new island i am making,and create a new one and assign it to the island and choose a random color,that color won't apply automatically on the other prefabs or on the base prefab?

avatar image Sagi02 SP Designs · Jun 19, 2016 at 08:07 AM 0
Share

yep. Or you can use $$anonymous$$esh.material ins$$anonymous$$d of $$anonymous$$esh.shared$$anonymous$$aterial, it supposedly changes only the current instance of the material (this can't be done in the editor and requires scripting). Re if you want more details how to do this.

avatar image
0

Answer by josehzz112 · Jun 19, 2016 at 04:53 AM

This happens because all floating islands share the same material.

You could assing a new material to every new island (not the most efficient solution, but it should work).

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 Fritsl · Apr 07, 2017 at 10:58 AM 0
Share

I had these issues, and made a system to fix it. The result became an asset in the store. It's called $$anonymous$$ess $$anonymous$$anager in the Asset store. With it you can just select anything and assign new materials on a new prefab it makes on the fly from your template - with a single click. https://www.assetstore.unity3d.com/en/#!/content/85595

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

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

best practices for importing and updating models 0 Answers

What happened to my Materials and Prefabs? 1 Answer

gameobjects and prefabs losing materials 2 Answers

How to change a prefab's color before instantiating (with code) 1 Answer

Script is reading from prefab instead of instance 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