What are Scriptable Objects in Unity and How to use them | Unity Tutorial

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024
  • 🕹️Website: skye-games.com
    ✉️Contact: info@skye-games.com
    In this video we go over a brief summary of what scriptable objects are then we dive into an example showing you how you make use of them inside your games!

Комментарии • 33

  • @Konitama
    @Konitama 10 месяцев назад +10

    Just a note, Resources.Load is fine for small projects, but there is a 2GB limit with Unity when it comes to serializable files. So your Resources file can quickly balloon to the breaking point. You can store your Scriptable Objects as Addressables and then put them neatly into groups, just like they would be in an organized folder structure. This lets you easily grab just the objects in each group, and makes bundle files that are nice and small in file size.

    • @Skye-Games
      @Skye-Games  10 месяцев назад +4

      Very true.
      I suppose when the resources folder gets that big it begins having performance issues as wel..
      Great advice!
      Edit: wait no ways!! I just double checked and I have actually watched many of your vidoes a while back haha.
      Nice to see you commenting here!

  • @themirlabs
    @themirlabs Год назад +3

    I remember when i first learn about these. Sooo helpful when making allot of items in a game. speeds the process up allot.

    • @Skye-Games
      @Skye-Games  Год назад +1

      Yes they are great!
      Also useful for creating settings for scripts - not sure if you've used Photon before or Dotween which are good examples of this

  • @caeleng5553
    @caeleng5553 Год назад +3

    Super useful video. I personally find scriptable objects really confusing so this video has really helped a lot. Once again thank you so much :)

    • @Skye-Games
      @Skye-Games  Год назад

      Awesome!
      I am glad it helped :)

  • @JackPS9
    @JackPS9 10 месяцев назад +2

    I use a whole custom editor system I have been working on to make mine.
    I also use scriptable objects as a custom event system to trigger functions or even to pass data around that I have full access to which can make balance and debugging a little easier as well.

  • @gwm249
    @gwm249 Год назад +1

    Nice. Found the channel while checking up some info during load shedding. Very concise. I'm taking the game dev route a little later in life but hey, have to keep the brain working somehow :D

    • @Skye-Games
      @Skye-Games  Год назад

      Haha Awesome!
      I am guessing you're also South African with loadshedding?😅

    • @gwm249
      @gwm249 Год назад

      @Skye-Games yuppers. I try support local where I can. We have...unique challenges 😜

  • @darkman237
    @darkman237 4 месяца назад +1

    You could use another scriptable object to replace the Enum.

  • @FyresGames
    @FyresGames 10 месяцев назад +2

    To decouple my battle from my menu and main game I use scriptableobjects and it work great. Recently I've used it for my cutscene/dialogue system to store branchs choices. So refusing or accepting a offer in a dialogue may lead to a different cutscene.

    • @Skye-Games
      @Skye-Games  10 месяцев назад +1

      Awesome use cases!
      Thanks for sharing

  • @jamesstrickland8696
    @jamesstrickland8696 10 месяцев назад

    Hi! I hope you can help! Maybe scriptable objects would be my solution but I’d like to see what you think. In my project I’m generating a list of random characters with random variables. The player can add a random character to their character party to use that character in the game. I have a roster that holds a portrait for all characters that the player has chosen to add. The portrait is a button laid on top of an image with a text box attached. I made this a prefab that is instantiated every time a character is added and then placed onto a grid layout for the player to view.
    What I want to do is to make it so the player can click on the prefab while in this roster view menu, which essentially should take the data of that character and add it to the player specified party (as there will be multiple parties in the game). But I’m not sure how to make each instantiated prefab hold a reference to a particular character. Again, these characters are randomly generated and are not predefined prior to runtime. I don’t think scriptable objects would work here would they? Do you know what solution I could go with? Thanks!

    • @Skye-Games
      @Skye-Games  10 месяцев назад

      Hey,
      Sure you could use scriptable objects for this but it definitely isn't the most effective way.
      All you need is a 'model' class that stores the random character/s and pass instances of that to the class which is responsible for displaying it on the UI

  • @clay-altenen4046
    @clay-altenen4046 Год назад +1

    Very nice Video keep it Up.

  • @kamisama3202
    @kamisama3202 Год назад +1

    thank for helpful video

    • @Skye-Games
      @Skye-Games  Год назад

      My pleasure!
      Glad it helped😁

  • @stackflow4007
    @stackflow4007 11 месяцев назад

    Good job! Can you increase the font size its too small. :D
    BTW, what's the difference between scriptable objects and creating normal class objects?
    We can achieve the same thing with class objects right?

    • @Skye-Games
      @Skye-Games  10 месяцев назад

      Hey,
      Thanks for the feedback.
      No. You can't achieve the same thing with Monobehaviour/class objects.
      Firstly, you can't add scriptable objects to game objects (which I assume you know already),
      But the importance of scriptable objects is that using the "CreateAssetMenu" attribute allows you to store 'instances' (for lack of a better term) of a scriptable object class as a permanent Asset, which you cannot do with class objects as objects *HAVE* to be instantiated at runtime
      Edit: hope this makes sense!

  • @emretasdemiir
    @emretasdemiir 7 месяцев назад

    Hey i used once the scriptable objects like that but i have an issue, my game will be a really big game so i needed to make dictionaried and store the items there according to their categories, also i store data in a json and problem starts here, when i try to save the scr. Objects into a json, they are being just an instance id, and cant load anything when i build the game, so what can be the solution for this method? i actually found a different way which is less accurate but working for now and i wanted to hear your advices.

    • @Skye-Games
      @Skye-Games  5 месяцев назад

      I am not sure...
      I have never had to serialize scriptable objects, but some google searches should do the trick

  • @guilhermeirieclaudio8759
    @guilhermeirieclaudio8759 Год назад +1

    0:13 Finn's Swords c:

  • @CorbieGame
    @CorbieGame Год назад +1

    Could you share with me this source please!

    • @Skye-Games
      @Skye-Games  Год назад

      Hey!
      I don't do this so that you watch the video and learn how to do it yourself,
      Hopefully you understand!

  • @squitz7056
    @squitz7056 Год назад

    hey i was wondering if have experience making multiplayer games? i am developing a fps for about 9 months and made my own networking solution. you seem like a bright chap wondered if we could share some ideas :D

    • @Skye-Games
      @Skye-Games  Год назад

      Hey,
      Yes I am very familiar with multiplayer development in photon PUN 2, and I have in the past used sockets to connect and sync up game objects between 2 p2p clients.

    • @Skye-Games
      @Skye-Games  Год назад

      Where are you from?
      Getting on a Discord call would be cool😁

  • @malikmuhammadarslan9993
    @malikmuhammadarslan9993 Год назад

    Please make firwbase tutorials

    • @Skye-Games
      @Skye-Games  Год назад

      Hey,
      Firebase can have lots of problems in Unity.
      What do you need it for?