Search Unity

Switching out GOs

Discussion in 'General Discussion' started by nickavv, May 27, 2007.

  1. nickavv

    nickavv

    Joined:
    Aug 2, 2006
    Posts:
    1,801
    If I had a buncha prefabs, could I have something where you choose one on a menu screen in game and for the rest of the game it swaps the default GO for the chosen GO? Practical Example Time:
    A parts select screen before a race. You could switch out different tire prefabs that look slightly different and have different scripts attached; switch out chassis that have different textures on them, etc..

    Practical/doable? Thanks!
     
  2. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
    Yes, practical and doable for sure. It's just a matter of deciding how/where to store the selection information. Then when you load the car or whatever, you read the selection information and swap in/out GOs as necessary. Examples:

    - when the user selects their custom parts store that as a preference, then when you later load their vehicle read those prefs again and customize the vehicle

    - when the user selects their custom parts store that information in a persistent GO, then when you later load their vehilce query that persistent GO for the info and customize the vehicle

    I'm sure there are more ways to do it but it's all quite possible.
     
  3. nickavv

    nickavv

    Joined:
    Aug 2, 2006
    Posts:
    1,801
    That's good to know. It could have lots of uses (ie. outfit swapping). I'll work on it. :)
     
  4. thylaxene

    thylaxene

    Joined:
    Oct 10, 2005
    Posts:
    716