Scriptable Cookbook: Scriptable Object Variables and Actions

Поділитися
Вставка
  • Опубліковано 29 вер 2024

КОМЕНТАРІ • 74

  • @paritoshvaidya9629
    @paritoshvaidya9629 4 роки тому +1

    i agree with the Tarip Mehmood your vedio is great , your channel deserves more views

    • @newbquesttv
      @newbquesttv  4 роки тому

      Thank you, that’s very kind of you to say.

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

    Sciptable Objects are the shit

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

      Glad you think so! They have their limitations too and it's possible to create spaghetti in any pattern but I do think that they help a lot and are underutilized.

  • @legathus
    @legathus 4 роки тому +13

    Quality stuff. Your views are criminally low.

    • @newbquesttv
      @newbquesttv  4 роки тому +2

      Appreciate the kind words :)

  • @Frank_G_Finster
    @Frank_G_Finster 4 роки тому

    This was very helpful. Nicely explained, easy to understand. Thank you very much, liked and subscribed.

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

    7:32 I love the moment you look at your own code and say "Wow...I can't believe that compiles." I laughed really hard at that. :D

  • @filipathtc
    @filipathtc 4 роки тому +3

    1:50 video beginning

  • @charlescoxart245
    @charlescoxart245 4 роки тому +6

    Legit one of my favorite Unity tutorial devs. Thank you for proving great tutorials over the years!

    • @newbquesttv
      @newbquesttv  4 роки тому +1

      Thanks Charles! Really kind of you to say :)

  • @a3dadventure79
    @a3dadventure79 8 місяців тому

    thanks for making these vids and putting together this playlist. a great resource to level up your unity/c# skills, and dive into SO. keep em coming, great work!

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

    This is awesome Thanks for the video! I was wondering how you would handle something that had a delay on it. For example lets say instead of actions you have almost the same code but called buffs instead and lets say it doubles the player object size. If i want it to be a temporary effect that after a "float duration" reduces the player size back to normal how would you go about it? I tried a coroutine inside the scriptable object and quickly found out it does not like that. Instead of the "PerformAction" i have two functions called "Apply" to apply the buff to the gameobject and "Remove" that is a coroutine. In a new script called Buffer that takes a Buff i just call the apply function and then start the coroutine but it also means i cannot destroy the gameobject (just a cube on the ground).
    If someone has a suggestion on how to do it a bit more elegantly it would be really appreciated.

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

    thank you! I've been trying to figure out an inventory item action feature all day! an example of what I'm making is in Rust - when you select an item on your inventory screen there are some buttons by the description that show up. All items have a drop button, but some have custom behaviours like unload ammo, eat, etc. Im making my inventory system more for the developer rather than the player, i dont have a specific project in mind I'm just making a item system i can drag into a project that needs it, so it must be very multipurpose. This multipurpose action structure helped alot!

  • @_WiseMass
    @_WiseMass 4 роки тому +4

    Forever grateful for your contribution to the Unity developers community. Your channel needs more views as it rightly deserves. Not sure why it hasn't been so visible!!

    • @newbquesttv
      @newbquesttv  4 роки тому +2

      Thanks so much Tariq! That’s super kind of you 🙏

    • @timsem2624
      @timsem2624 4 роки тому

      I think the content can effect, for example i am looking info for turn based state machine, pattern. Some RPG stuff. Some of useful information was provided by Matt, and time to time check new Matt's videos. I like how Matt makes tutorials.

    • @newbquesttv
      @newbquesttv  4 роки тому

      @@timsem2624 Thank you!

  • @darkman237
    @darkman237 3 роки тому

    If you have a list of items in an item database and you want to "load" a single item out of it and instantiate it on a canvas/panel, you would do something like this?
    to show everything in the database. If so, why would it give a null reference?
    for (int i = 0; i < database.Items.Count; i++)
    {
    Debug.Log(i);
    Debug.Log("Name: " + item.Name);
    Debug.Log("ID: "+ item.Id);
    Debug.Log("Description: " + item.description);
    Debug.Log("Type: " + item.type);
    Debug.Log("Value: " + item.value);
    Debug.Log("Weight: " + item.weight);
    }

  • @VoltFall
    @VoltFall 3 роки тому

    quick question when should we use scriptable objects I know I'm supposed to use it for huge data but I'm talking more in-depth like inventory system

  • @lee1davis1
    @lee1davis1 3 роки тому

    Amazing vid. I so missed youbask the unity tutorial speaker.

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

    Thanks for this! I like the concept of modulating the scripts.

  • @danchambersanimation
    @danchambersanimation 4 роки тому +2

    Really appreciate the way you use your tone and gestures to explain the concepts. I'm struggling a bit with Scriptable Objects at the moment but viewing this video I can feel the gears of understanding start to grind forward a few more degrees!

    • @newbquesttv
      @newbquesttv  4 роки тому +1

      Glad to hear it! I'm also releasing videos on the Thousand Ant channel now about ScriptableObjects as well so check that out if you haven't seen it.

  • @Waladuz
    @Waladuz 4 роки тому +2

    Dude, I owe, you saved me a major architecture problem in my game. Much love!

  • @raulsaavedrariera8294
    @raulsaavedrariera8294 4 роки тому +2

    Very good work as always, we discover a world of possibilities with each video. You deserve that the number of subs has a few extra zeros

    • @newbquesttv
      @newbquesttv  4 роки тому

      Thanks Raul! Very kind of you :)

  • @Ne0mega
    @Ne0mega 4 роки тому +2

    I finally got the hang of scriptable objects about a month ago, and love them. I use them for everything now (except serialization!)

    • @newbquesttv
      @newbquesttv  4 роки тому

      That’s great! They’re really useful.

    • @quentinturner9383
      @quentinturner9383 4 роки тому

      I was thinking of using scriptable objects to automate sterilization at runtime. Can someone explain to me why not please?

  • @syedsadiq8631
    @syedsadiq8631 3 роки тому

    This man so good for understand to c sharp

  • @vickdeweo4288
    @vickdeweo4288 4 роки тому +1

    Basic Pause menu with volume and SFX slider that persist with a scriptable object?

    • @newbquesttv
      @newbquesttv  4 роки тому +1

      Yeah that’s a fun one! You could store the values between plays by writing to disk as JSON. You could also do it with playerprefs which might be easier.

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

    Such a cool and simple system. Thanks Matt, these videos are great.

  • @zakhounet
    @zakhounet 4 роки тому +1

    Hi Matt, I am a fresh learner on Unity and learning a lot thanks to you. Iwas wondering if wether or not it will be agood idea to use scriptableobject so store a 52 card Games (Sprite, Suit, Value, ...) for let's say a poker game or any other card game ?

    • @newbquesttv
      @newbquesttv  4 роки тому

      Yeah for sure! Check out Brackeys video in the Scriptable Cookbook Playlist, he does a hearthstone like example.
      Glad you’re finding it useful!

    • @zakhounet
      @zakhounet 4 роки тому

      Thanks for the advise. I have watched the very good Brackey video but I still wondering if I could make the entire cards game with or without instantiate each card or just use the sciptableobject which is not a gameobject?

    • @newbquesttv
      @newbquesttv  4 роки тому

      I would use SOs to hold the card templates and a game object that displays them in game. You need the gameobjects still you just don’t need a lot of unique prefabs. Make sense?

  • @TheJonBrant
    @TheJonBrant 4 роки тому +1

    This is awesome. So many useful possibilities. Thanks!

  •  4 роки тому +1

    Interesting way to use scriptable objects! Personally I prefer all business logic to be in code and be unit tested and some of the use cases like despawning after dying falls too close to business logic in my mind, but I can sure see interesting ways to use the principle of it. Also, people who are not very confident in their coding skills may have very good results from this I guess.

    •  4 роки тому +1

      Now, that being said, I think scriptable objects are a great topic! I use them for a lot of things myself, but mostly as a part of implementing prototype pattern where they carry all important data for a type of enemy, a type of weapon, ammo etc.

    • @newbquesttv
      @newbquesttv  4 роки тому +1

      @ Thanks! Yeah I am definitely not trying to hold this up as the one true way, everyone tends to hold their opinions about architecture closely, more just a pattern I've enjoyed working with that many folks may not be aware of. And yes, as you say, for folks who are maybe more on the design side than programmer side they may find this structure pleasant. Glad you found it interesting!

  • @BJ-hh3tf
    @BJ-hh3tf 3 роки тому

    Thank u i like your videos, i'm thinking about if we can use this to implement observal pattern ? if yes which is (better/more performante) using SO or events ?

  • @TopShelfCookieJar
    @TopShelfCookieJar 4 роки тому

    Incredibly well explained sir. Thank you!

  • @nerdydrow
    @nerdydrow 4 роки тому +1

    Can you please do a video about how to use them as Events ?

    • @newbquesttv
      @newbquesttv  4 роки тому

      Hey yes I will, it’s on my list. Thanks!

    • @nerdydrow
      @nerdydrow 4 роки тому

      @@newbquesttv no, thank YOU

  • @godsofthesingularity8308
    @godsofthesingularity8308 4 роки тому

    I started learning unity, blender, Csharp n everything two months ago. Everything was easy until I ran into these 'scriptable objects.' I mean... I understand how to use them. I just don't understand what's happening under the hood. I don't understand how that data is stored in memory. Is the variable stored in file?
    For example... let's say I setup an enemycount scriptable object. I plug it into an enemycounter script on my enemy prefab that increments it up every time an enemy is spawned and increments it down everytime an enemy is destroyed. (so using a SO instead of a static to keep enemy count) Now, what happens if the game crashes? When the player reboots the game... the value won't have been incremented down by the ondestroy functions? So the enemy count will start where it left off instead of at zero? This is something that was confusing me. I feel like these scriptable objects are TOO persistent or something. (edit... ok oh. They still have onEnable and OnDestroy functions. I just used that to set my enemycount to zero.Sorry. Still learning.)

    • @newbquesttv
      @newbquesttv  4 роки тому +1

      No worries, I agree it can be confusing. Remember that values written into them WON'T be saved unless you save the asset database. If you want to persist values you should write to playerprefs or a JSON or binary file. I think this aspect of SOs is one place people get hung up and I actually probably wouldn't recommend using them this way right away as a beginner.

  • @gamedoelcaminodelvideojuego
    @gamedoelcaminodelvideojuego 4 роки тому

    Thanks for the tips, I use scriptable objects for game objects like ring, staff, weapons, with abstract class and scriptable object I can make easy magics and powers!

    • @newbquesttv
      @newbquesttv  4 роки тому

      That's great! I think abilities and items are a great use case

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

    It looks like you no longer make youtube videos anymore, but thank you so much for this video! the action section was fantastic! and then you blew my mind with the sneaky animator part! you have no idea how timely that information is for me! Thanks!

  • @rakibjahan
    @rakibjahan 4 роки тому

    Amazingly simple and convenient! Great content, Thank you

  • @codytedrick3060
    @codytedrick3060 4 роки тому

    Hey Matt, this is a really interesting video - I love seeing interesting uses of SOs. Excited to try this out!

    • @newbquesttv
      @newbquesttv  4 роки тому

      Cool thank you! Glad you found it interesting.

  • @mana20
    @mana20 4 роки тому

    I wasn't sure what channel this was until I heard your voice. Are you going solo or are you still working for Unity?

    • @newbquesttv
      @newbquesttv  4 роки тому +2

      Yeah I moved into managing the online team at Unity so don’t really make as much content myself for them now, so this is my chance to keep my skills sharp and do my own stuff. I still work there.

    • @mana20
      @mana20 4 роки тому

      @@newbquesttv awesome! Looking forward to future content.

  • @iskir677
    @iskir677 4 роки тому

    This is just what I wanted to implement thank you so much!

  • @archeroliver6078
    @archeroliver6078 4 роки тому

    Very interesting implementation!

  • @introvertio4399
    @introvertio4399 4 роки тому +1

    Drip king... your handsome host

  • @TheCodesnippet
    @TheCodesnippet 3 роки тому

    Wow thank you very much, this video is great! It is very difficult to find vids like this, where very detailed information about the topic are explained to us taking into consideration the overall architecture. This is exaclty the type of tutorial I'm looking for ! I cannot explain to myself why you have only 4,4k followers... unbelievable for me, you are very underrated. Obviously I've subscribed your channel!

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

      Thank you! Appreciate the kind words. I think the reason this stuff is low views is because it's not "fun" and "exciting" or beginner content. The business model of UA-cam works against this type of content if you're trying to monetize.