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

Поділитися
Вставка
  • Опубліковано 20 січ 2025

КОМЕНТАРІ • 34

  • @Konitama
    @Konitama Рік тому +11

    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  Рік тому +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!

  • @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 :)

  • @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

  • @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 😜

  • @FyresGames
    @FyresGames Рік тому +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  Рік тому +1

      Awesome use cases!
      Thanks for sharing

  • @JackPS9
    @JackPS9 Рік тому +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.

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

    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  10 місяців тому

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

  • @darkman237
    @darkman237 9 місяців тому +1

    You could use another scriptable object to replace the Enum.

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

    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  Рік тому

      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

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

    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  Рік тому +1

      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!

  • @clay-altenen4046
    @clay-altenen4046 Рік тому +1

    Very nice Video keep it Up.

  • @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!

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

    thank for helpful video

    • @Skye-Games
      @Skye-Games  Рік тому

      My pleasure!
      Glad it helped😁

  • @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😁

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

    0:13 Finn's Swords c:

  • @giotto_4503
    @giotto_4503 3 місяці тому +1

    I love yhese bite size videos

  • @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?