Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Prefab with changable appearance

Discussion in 'Getting Started' started by minidmnv, Jan 11, 2019.

  1. minidmnv

    minidmnv

    Joined:
    Jan 5, 2019
    Posts:
    1
    Hey guys!

    I was trying to find answer for this question for about 2h now on, but no luck.

    I'm wondering what's the best approach to get (for example) hero in my MainScene which can have different initial variables values, and different appearance, I've came up with two ideas:
    First is to create a multiple prefab variants and just instantiate one based on variable passed from MainMenuScene(example, again).
    Second - I've not tested it yet - is to somehow pin multiple graphics to one game object and just render one, that should be visible, also pass multiple values which I can pass to game object instance then.

    Have You faced similar problem? What You can tell about that and which way should I choose based on Your experience?

    Thanks for Your replies!

    Cheers.
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    7,528
    I'm not sure I understand what you're asking. When you drag a prefab into a scene, you don't need to leave all its property values as they are in the prefab. You can change any variables (including materials) you like, and Unity will keep track of which ones you've changed, and which are using the standard prefab values.