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 spinnerbox · Sep 22, 2015 at 12:57 PM · prefabsmaterialstextures

Cannot make another prefab of same model

I have this model in unity https://www.assetstore.unity3d.com/en/#!/content/4331

What I want to do is make one red samurai as the player and I want the same model to be as a prefab but with blue tinted texture instead. I managed to copy the base texture and use color balance in Gimp to change the red parts into blue, so now I have a blue texture. I also created a material with this new blue texture.

The problem I have is when I change material on the Blue Samurai to be with the blue texture it also changes the texture on the Red Samurai though I have those two game objects as a prefabs as well. I guess I change the exact same subobject of the red and blue samurai that is holding the body of the samurai. If I select the body subobject and then press right click -> "select prefab" on "plane007" it shows on the same exact prefab subobject holding the body of the samurai

How can I separate and make two prefabs with different texture/material?

I cannot see "duplicate" button in the prefabs folder.

prefabs-red prefabs-blue

samurai-prefab1.png (510.6 kB)
samurai-prefab.png (509.6 kB)
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

3 Replies

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

Answer by spinnerbox · Sep 23, 2015 at 02:38 PM

Probably this is a noob question but at the time I was confused what do I do wrong. I found an even better way to assign different material to the two Samurais. If you check the images carefully, they have Skinned Mesh renderer which allows you to select different material. I did tried that and now I have two different Ninjas, blue and red.

I would keep it just so somebody learning Unity might find this question useful. But yes above solutions work as well.

samurai-prefab-4

samurai-prefab-3


samurai-prefab4.png (54.8 kB)
samurai-prefab3.png (333.4 kB)
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 sys12 · Sep 25, 2015 at 03:06 PM 0
Share

This method is actually much better. It will batch the meshes and optimise the performance. But if you want to generate the prefabs dynamically, it could be complicated.

avatar image
1

Answer by sys12 · Sep 22, 2015 at 01:03 PM

Attach script to your prefab with 2 public fields like:

 public Material m_material;
 public Texture2D m_texture;

And apply them to your mesh renderer. Drag your textures and materials to the script of each gameobject created by prefab in editor.

Comment
Add comment · 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
1

Answer by LessThanEpic · Sep 22, 2015 at 01:05 PM

Two things.

1) To make a new prefab click one of the game objects in the hierarchy pane and drag it into the project pane.

2) Make sure the two prefabs are using different materials. In the Skinned Mesh Renderer component there's a Materials section. If both game objects are pointing to the same material then they're going to be the same color, regardless of whether or not they have different prefabs.

Comment
Add comment · 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

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

30 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 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 avatar image avatar image avatar image avatar image

Related Questions

How can I make that everyTime I change the texture of material, it won't change texture of every Instantiated Object that has that material 2 Answers

best practices for importing and updating models 0 Answers

When creating a 2D array as a grid of cubes they are all the same colour,My array of gameObjects are all the same colour, even when I set them differently 2 Answers

Two textures one Material 0 Answers

Do textures for materials need to be in Resources folder also? 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