Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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:
    9,859
    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.