Prefabs & Prefab Variants - Unity Tutorial

Поділитися
Вставка
  • Опубліковано 8 вер 2024
  • Learn what prefabs are, how to use them, and how to take advantage of prefab variants to maximize re-usability in your games.
    ❤️ Become a Tarobro on Patreon: / tarodev
    =========
    🔔 SUBSCRIBE: bit.ly/3eqG1Z6
    🗨️ DISCORD: / discord
    ✅ MORE TUTORIALS: / tarodev
    About Tarodev:
    Develop video games like a pro!
    Whether you're a beginner or a seasoned game developer, you'll find lots of useful tips and tricks to boost your development career. Visit the channel: / @tarodev

КОМЕНТАРІ • 26

  • @marilynjay
    @marilynjay 3 роки тому +8

    Super helpful! I understood prefabs but I didn't understand the variants until this video.

    • @Tarodev
      @Tarodev  3 роки тому +2

      They're super handy. Always make a 'base' variant for game units as they'll usually share certain components like healthbars, colliders, etc.

  • @margobelorukova
    @margobelorukova 2 роки тому +3

    That's a great explanation. Thank you for keeping it concise and short.

  • @iglonudel1680
    @iglonudel1680 Рік тому +1

    This is really cool, thanks for the easy to understand explanation too :D

  • @JW-uu9je
    @JW-uu9je 2 роки тому +1

    I really appreciate your videos! Thank you.

  • @noobcraft5712
    @noobcraft5712 3 роки тому +1

    good vidio will help when making longer games whe I am at intermidiat level in game dev. :)

  • @Floatharr
    @Floatharr Рік тому

    Thanks for the tutorials! Went through basically every video on the channel today, best C#/Unity content on youtube. Regarding this video: crazy thought, but isn't this roughly analogous to inheritance? Would it make sense to have a base prefab, then variants for dynamics or interactables, and assets would be a variants of those. Then you could do stuff like toggle shadows for every object at once, or change interaction distance for every button/door/switch in the game. Probably exactly why variants were even made. Maybe there could even be scripts for stuff like mesh colliders made automatically from the mesh filter. Something to tinker with later.

  • @richienko2
    @richienko2 2 роки тому +1

    very good tutorial, subscribed right away :)

    • @Tarodev
      @Tarodev  2 роки тому

      Welcome aboard

  • @masonmason22
    @masonmason22 2 роки тому +1

    Nice video. Thanks!

  • @m_maksym
    @m_maksym 2 роки тому

    maaaaan you're good) and interesting themes and all's clearly explained. I'm glad i found your channel! Mb let's create some game?

  • @omega_dip_wod
    @omega_dip_wod 3 роки тому +1

    such a good lesson!

  • @abhay2166
    @abhay2166 Рік тому

    thank you

  • @Neren728
    @Neren728 Рік тому

    Thanks from Russia!

    • @Tarodev
      @Tarodev  Рік тому

      это сообщение с автоматическим переводом

  • @Lashistoriasdelilith
    @Lashistoriasdelilith 2 роки тому +2

    hi, I've tried making 3 different kids of balls. All of them are different sizes and that works just fine, but when I change the color, it applies to all the variants, included the original one. Can you help me please?

  • @RimuruDev
    @RimuruDev Рік тому

    Cool!

  • @raxacoricofallapatorius8484
    @raxacoricofallapatorius8484 5 місяців тому

    great, but why not explain the benefits in performance of doing this, rather than creating each one as its own standalone prefab?

  • @youssefbencheikh8637
    @youssefbencheikh8637 Рік тому

    Something i couldn't wrap my head around in varaints is the part of the manual that says "Note: When editing a Prefab Variant in Prefab Mode, you should understand that applying these overrides (via the Overrides drop-down window or context menus) will cause your variant’s variations to be applied to the base Prefab Asset. This is often not what you want. The point of a Prefab Variant is to provide a convenient way to store a meaningful and reusable collection of overrides, which is why they should normally remain as overrides and not get applied to the base Prefab Asset." Could you please clear this up?
    Thanks in advance

  • @batuhanbatuhan4131
    @batuhanbatuhan4131 2 роки тому +1

    so this is basically what classes are in unity. you make an instance var turn into a class by turning it into a pfab and you can create subclasses from it.

  • @vishnu2737
    @vishnu2737 2 роки тому

    Which shader you are using for slime?

  • @CCV334
    @CCV334 2 роки тому

    How do you make the slime shader? I really like how that looks.

  • @ryo_chr
    @ryo_chr Рік тому

    when i create the prefabs folder and drag in a model, it doesn’t become a prefab. it stays a model

  • @akashtechdeveloper
    @akashtechdeveloper 2 роки тому +1

    Hi sir ji I need help how to access child of prefab through script in unity?

    • @Tarodev
      @Tarodev  2 роки тому +1

      Depends what you need to grab. You there is a script or component on a child you need you can do: transform.GetComponentOnChildren();
      If you need simply one of the child transforms you can do transform.getChild(i)

    • @akashtechdeveloper
      @akashtechdeveloper 2 роки тому

      @@Tarodev okk