This is EXACTLY the channel I was looking for. As someone with a software engineering background being able to find concise, straight to the point videos about Unity features I didn't know existed without the pandering "here's how you erm... assign variables... and uh inheritance is a concept where" bs is great. Having these videos should be helpful for those learning too. You could either A: follow along exactly from a tutorial and learn nothing but make it work, or get an idea and learn it along the way, which is what this type of content is geared towards. Great stuff.
Couldn't agree more, videos that are just like: "this is a thing, this is how its used" Are gold. Now to go and do some experiements with scriptable objects
@Alvin When you need to reuse a certain data structure in many game objects that can base their behaviour on that set of data. The example was in the video: Different cars with different speeds and accelerations, even sprites or materials.
@Alvin One of the main use cases for ScriptableObjects is to reduce your Project’s memory usage by avoiding copies of values. This is useful if your Project has a Prefab that stores unchanging data in attached MonoBehaviour scripts. Every time you instantiate that Prefab, it will get its own copy of that data. Instead of using the method, and storing duplicated data, you can use a ScriptableObject to store the data and then access it by reference from all of the Prefabs. This means that there is one copy of the data in memory
@@robosergTV So let's say you want the same set of stats for all the actors in your game Player and NPC alike, instead of giving each their own stat block you can make a stat block as a scriptable object have each actor reference it and then assign their own values to it.
I have nothing to do with game development but still... I'm intrigued by all of those guides. They are so fascinating and straight to the point without any bullshit. Such a rare breed of guide, here on youtube out of all places, it's refreshing to look at.
I have to say a big thank you for the examples in this. I'm coming back to Unity after a long break and it's been a great refresher as well as some advice/examples that I've not come across in my previous learning. Great job!
Wonderful video! It's surprising how much valuable information you were able to cram into 4 minutes. Extremely useful for those who might already know about the subject but don't know the neat more advanced use scenarios like nesting and doing more than just storing variables.
So sad that such an awesome channel did not get enough attention so the owner would kept publishing more video tutorials, thanks for this one, I will give it a try in real project.
Wow, I only discovered your channel today. You are seriously a Godsend. thank you! all your videos are so clear and concise and the way you edit your videos make it so it's not some boring video. Thanks! Subbed :D
Scriptable Objects can be used for components to talk to eachother if they have the same Scriptable Object. Scriptable objects can also hold the logic of a Monobehaviour. Enabling you to share behaviours or quickly change between behaviours without changing the component. Using Custom Property drawers and reflection you can make a popup field that shows all scriptable objects that derive from a given base scriptable and automatically creates that objects for you in a defined folder(that also saves you the tedious work of everytime creating an asset menu, even if you just need the object once) Scriptable objects also can save Playmode Data (only in editor) There are a lot more usecases than just using them as dataobjects, and it's quite a shame that not more people use them or just use them to a limited degree.
(new to unity) I would love to see more about Scriptable Objects, I have been thinking of an easy way to add, remove and organize content in a game idea I have. Basic idea is that each character would be a scriptable object, all having the same required assets and info, then with a character manager scriptable object would store all of the characters in a single list that would make it easy to set the cost and if the character is visable in the store. idk how far this could go, but I could also create a Store manager Scriptable object that connects all of the managers like character manager, weapon manager, banner/avatar manager, etc. this could have even more up level controls like 50% discount on all weapons.
I have been using scriptable object with more of inventory but I've been looking into more of using scriptable object in AI and I will say that from testing it out with AI find it quite interesting.
if i have a nav mesh agent with a movement, targetting, health etc scripts attached would it be benificial to make a scriptable object as each unit of the same type and upgrade will behave the same
Don't know if anyone can answer me this, but I just discovered this and I am wondering if you can make custom voids with this. Context: I am making a game where you have a number of Spells. What I did was: Create an abstract SpellBase class, extending Monobehaviour. It shares all the attributes every spell has, such as cost, cooldown, name, description... and an abstract void called UseSpell(). Then, I create other scripts that inherit SpellBase and implement UseSpell(), such as a HealingSpell class, which also adds attributes such as the amount you heal, or a SpeedBuff class, that has a multiplier variable. Then, another script (SpellLogic) gets a list of all existing spells and when certain key is pressed, you cycle through that list and have a certain spell selected. Another key will trigger said Spell's UseSpell() implemented method. Is there anyway for, instead of SpellBase extending MonoBehaviour, it can extend ScriptableObject? Could I even extend both? Can it still be an abstract class?
If i make a base scriptable object class and then a sub-class from that one, once the derived class is created in the inspector, changing default values in the base class won't affect the ones in the sub-class already packed in the asset file. Could you explain what you meant by changing health on the base SO and affecting all the derived ones? Just don't see it working that way. It will work but for new created assets.
So for example if I wanted a player character I not only could add health and damage but also functions for attacks they should all be able to use, and make them virtual, so the script that uses the scriptable object can either use the base attacks or override them. But does this mean for example that I must create a scriptable object for every single enemy that should be unique? What if you remove a scriptable object from the project?
But i've always been using plain old Game Objects for having a "static" data holder! (Like in the race car example) I'm still trying to figure out how scriptable obj is superior besides being used as a runtime instantiable script
One of the main use cases for ScriptableObjects is to reduce your Project’s memory usage by avoiding copies of values. This is useful if your Project has a Prefab that stores unchanging data in attached MonoBehaviour scripts. Every time you instantiate that Prefab, it will get its own copy of that data. Instead of using the method, and storing duplicated data, you can use a ScriptableObject to store the data and then access it by reference from all of the Prefabs. This means that there is one copy of the data in memory
Prefabs allow you to store hierarchy structures of game objects you can use elsewhere in your projects. Scriptable objects are best used for easily managing and controlling data structures. They're also a lot lighter to use than GameObjects. So, if you're just trying to store data, there's it's not very efficient or scalable to use GameObjects/Prefabs.
This video: "Put simply, they're a data asset" From the unity docs: "A ScriptableObject is a data container that you can use to save large amounts of data, independent of class instances. One of the main use cases for ScriptableObjects is to reduce your Project’s memory usage by avoiding copies of values. This is useful if your Project has a Prefab that stores unchanging data in attached MonoBehaviour scripts. Every time you instantiate that Prefab, it will get its own copy of that data. Instead of using the method, and storing duplicated data, you can use a ScriptableObject to store the data and then access it by reference from all of the Prefabs. This means that there is one copy of the data in memory" ????!?!?!?!?!??! guys
in my opinion, so contains game design info, is not something you need to adapt for each player. e.g. level of the final boss is always the same for every player, but different than previous subboss. if you want to save player progress, you store those variables by serializing
Inspiring , but there is an issue about how you handle the audiosource on scriptable objects with editor scripting. You need a live object with audiosource to play the sound even in editor mode. You are creating the object but there is no evidence that you are handling it later or destroying after the playback , which I could not make yet. Sound part is just thrown in but not explained properly . Can you please open it up alittle.
Actually, wait.. If you have to assign a reference to this object, it's not even static. Just a script that doesn't need to sit on an empty gameobject in the scene? Not sure if it adds anything really
If only SO could keep data when the project was build and not only in RunTime mode in the Editor :/ Yeah, I know... just store the data in the file and let SOs read them when a game is starting...
So just public class data with a prefab instance. I think I will never use them. Speed, health, attack, damage are public values in your class. Just make a new instance and then a prefab of it. Same problem solved.
This is EXACTLY the channel I was looking for. As someone with a software engineering background being able to find concise, straight to the point videos about Unity features I didn't know existed without the pandering "here's how you erm... assign variables... and uh inheritance is a concept where" bs is great. Having these videos should be helpful for those learning too. You could either A: follow along exactly from a tutorial and learn nothing but make it work, or get an idea and learn it along the way, which is what this type of content is geared towards. Great stuff.
Couldn't have said it better myself! These videos are great!
THIS! A thousand times over!!
Yes!
This has been an issue for me tenfold in looking for quality Unity references!
You said it perfectly 💯%
Couldn't agree more, videos that are just like: "this is a thing, this is how its used" Are gold. Now to go and do some experiements with scriptable objects
would love to see a more in depth tutorial series about scriptable object
Same here
Same here
@Alvin When you need to reuse a certain data structure in many game objects that can base their behaviour on that set of data. The example was in the video: Different cars with different speeds and accelerations, even sprites or materials.
@Alvin One of the main use cases for ScriptableObjects is to reduce your Project’s memory usage by avoiding copies of values. This is useful if your Project has a Prefab that stores unchanging data in attached MonoBehaviour scripts. Every time you instantiate that Prefab, it will get its own copy of that data. Instead of using the method, and storing duplicated data, you can use a ScriptableObject to store the data and then access it by reference from all of the Prefabs. This means that there is one copy of the data in memory
@@robosergTV So let's say you want the same set of stats for all the actors in your game Player and NPC alike, instead of giving each their own stat block you can make a stat block as a scriptable object have each actor reference it and then assign their own values to it.
This is the most concise explanation of scriptable objects.
Oh wow, this sounds crazy useful. Can't believe I never knew about this one before. Here I was hardcoding data into my classes like a fool.
I have nothing to do with game development but still... I'm intrigued by all of those guides. They are so fascinating and straight to the point without any bullshit. Such a rare breed of guide, here on youtube out of all places, it's refreshing to look at.
This is the best tut about Scriptable Objects. Now I almost understand it.
Can't believe that you don't have more subscribers than this. This channel is absolutely fantastic keep up the good work!
I have to say a big thank you for the examples in this. I'm coming back to Unity after a long break and it's been a great refresher as well as some advice/examples that I've not come across in my previous learning.
Great job!
Wonderful video! It's surprising how much valuable information you were able to cram into 4 minutes. Extremely useful for those who might already know about the subject but don't know the neat more advanced use scenarios like nesting and doing more than just storing variables.
It took me a while to grasp that a gameObject using SO has to reference it as public, but after inspecting your code I figured it out.
So sad that such an awesome channel did not get enough attention so the owner would kept publishing more video tutorials, thanks for this one, I will give it a try in real project.
great simple and direct intro to the nature of SO
Bro you are so much more practical and basically like the adult show version of Brackeys I love you
Wow, I only discovered your channel today. You are seriously a Godsend. thank you! all your videos are so clear and concise and the way you edit your videos make it so it's not some boring video.
Thanks! Subbed :D
Wow, you did a great job explaining this topic I have been struggling with. Thank you.
Scriptable Objects can be used for components to talk to eachother if they have the same Scriptable Object.
Scriptable objects can also hold the logic of a Monobehaviour. Enabling you to share behaviours or quickly change between behaviours without changing the component.
Using Custom Property drawers and reflection you can make a popup field that shows all scriptable objects that derive from a given base scriptable and automatically creates that objects for you in a defined folder(that also saves you the tedious work of everytime creating an asset menu, even if you just need the object once)
Scriptable objects also can save Playmode Data (only in editor)
There are a lot more usecases than just using them as dataobjects, and it's quite a shame that not more people use them or just use them to a limited degree.
(new to unity) I would love to see more about Scriptable Objects, I have been thinking of an easy way to add, remove and organize content in a game idea I have.
Basic idea is that each character would be a scriptable object, all having the same required assets and info, then with a character manager scriptable object would store all of the characters in a single list that would make it easy to set the cost and if the character is visable in the store.
idk how far this could go, but I could also create a Store manager Scriptable object that connects all of the managers like character manager, weapon manager, banner/avatar manager, etc. this could have even more up level controls like 50% discount on all weapons.
Really loved to see so much informations delivered in 4 minutes yet in an extremely chill way
Very concise!! That's good, but I would like to know more! Love your videos.
You should have far more subs, the content is clear, understandable & easy to follow. Thanks.
I have been using scriptable object with more of inventory but I've been looking into more of using scriptable object in AI and I will say that from testing it out with AI find it quite interesting.
I’m currently using Scriptable Objects for a dialogue system in my RPG game! I’ve made a custom editor for them, too!
Amazing! can we get the code for the audio preview script?
Is it possible to have more in depth tutorial for hot topics like Scriptable Object please? Your tutorial videos are so nice thank you!
if i have a nav mesh agent with a movement, targetting, health etc scripts attached would it be benificial to make a scriptable object as each unit of the same type and upgrade will behave the same
Hi, Thank you for this video, Why do you put "override" in Play at 3:08?
But what if I want to change health as well? And how do you override the base data?
looking through the docs i was like wut? but this video gave me a clear overview. Thanks!
Got here right in time for another amazing video!
That copy and pasting option so deceptively simple but I forgot about it, wonder full!
Don't know if anyone can answer me this, but I just discovered this and I am wondering if you can make custom voids with this. Context: I am making a game where you have a number of Spells. What I did was: Create an abstract SpellBase class, extending Monobehaviour. It shares all the attributes every spell has, such as cost, cooldown, name, description... and an abstract void called UseSpell(). Then, I create other scripts that inherit SpellBase and implement UseSpell(), such as a HealingSpell class, which also adds attributes such as the amount you heal, or a SpeedBuff class, that has a multiplier variable. Then, another script (SpellLogic) gets a list of all existing spells and when certain key is pressed, you cycle through that list and have a certain spell selected. Another key will trigger said Spell's UseSpell() implemented method. Is there anyway for, instead of SpellBase extending MonoBehaviour, it can extend ScriptableObject? Could I even extend both? Can it still be an abstract class?
Don't nested prefabs make it kinda optional?
If i make a base scriptable object class and then a sub-class from that one, once the derived class is created in the inspector, changing default values in the base class won't affect the ones in the sub-class already packed in the asset file. Could you explain what you meant by changing health on the base SO and affecting all the derived ones? Just don't see it working that way. It will work but for new created assets.
I want in depth scriptable object. Like enemy character attachment
Thank u very much..nice demonstration
Thanks for the video it was pretty concise and informative
So for example if I wanted a player character I not only could add health and damage but also functions for attacks they should all be able to use, and make them virtual, so the script that uses the scriptable object can either use the base attacks or override them.
But does this mean for example that I must create a scriptable object for every single enemy that should be unique?
What if you remove a scriptable object from the project?
Would love to take a look at that whole audio preview thing though.
But i've always been using plain old Game Objects for having a "static" data holder! (Like in the race car example)
I'm still trying to figure out how scriptable obj is superior besides being used as a runtime instantiable script
One of the main use cases for ScriptableObjects is to reduce your Project’s memory usage by avoiding copies of values. This is useful if your Project has a Prefab that stores unchanging data in attached MonoBehaviour scripts. Every time you instantiate that Prefab, it will get its own copy of that data. Instead of using the method, and storing duplicated data, you can use a ScriptableObject to store the data and then access it by reference from all of the Prefabs. This means that there is one copy of the data in memory
@@robosergTV unless you're making a total war game with hundreds of units on the screen, I doubt it'd make much of a difference.
Yes I would like to use them in my big games in in the middle of..but need more videos on them.
That sound FX preview thing looked really cool. Would you be able to share the code for that?
Didnt he already in the video?
What's the difference between a scriptable object, and a prefab'd empty game object with the transform removed and a script slapped on?
There will be more about them?
Hmmm, can't you already do this with prefabs though? Would it be better to have the race car stats on a race car prefab?
Prefabs allow you to store hierarchy structures of game objects you can use elsewhere in your projects. Scriptable objects are best used for easily managing and controlling data structures. They're also a lot lighter to use than GameObjects. So, if you're just trying to store data, there's it's not very efficient or scalable to use GameObjects/Prefabs.
could I use it with interactables?
Set different actions, animations, sounds in a single scriptable object
But i could also simply use a static class to do this, right?
I've used ScriptableObjects as DAO, to access an SQLite DB as I don't quite like the Unity saving system.
This video: "Put simply, they're a data asset"
From the unity docs: "A ScriptableObject is a data container that you can use to save large amounts of data, independent of class instances. One of the main use cases for ScriptableObjects is to reduce your Project’s memory usage by avoiding copies of values. This is useful if your Project has a Prefab that stores unchanging data in attached MonoBehaviour scripts. Every time you instantiate that Prefab, it will get its own copy of that data. Instead of using the method, and storing duplicated data, you can use a ScriptableObject to store the data and then access it by reference from all of the Prefabs. This means that there is one copy of the data in memory" ????!?!?!?!?!??! guys
xD
So what's your point? This video explains all of that with a concrete example.
Better than brackeys. Subscribed
Blob's your uncle ^^
SO are amazing for game design but disaster in saving as they cannot be serialized, could you please post a tutorial for that?
in my opinion, so contains game design info, is not something you need to adapt for each player. e.g. level of the final boss is always the same for every player, but different than previous subboss.
if you want to save player progress, you store those variables by serializing
Inspiring , but there is an issue about how you handle the audiosource on scriptable objects with editor scripting. You need a live object with audiosource to play the sound even in editor mode. You are creating the object but there is no evidence that you are handling it later or destroying after the playback , which I could not make yet. Sound part is just thrown in but not explained properly . Can you please open it up alittle.
So it's just a script that has everything static by default?
Actually, wait.. If you have to assign a reference to this object, it's not even static. Just a script that doesn't need to sit on an empty gameobject in the scene? Not sure if it adds anything really
Where’s the music from?
Amazing tutoring
Thanks a lot
This is so cool, thanks for the info.
Please use them and show them more :)
thank youuuu
Really feels like scriptable objects properly split up the Components and Systems for ECS
Before they had this we used json text file to store the data
감사합니다.
Why didn't you show how to do the inheritance of scriptable objects? This would have been the most interesting in the video
Thanks!
This seems similar to prefab variant in many ways.
If only SO could keep data when the project was build and not only in RunTime mode in the Editor :/
Yeah, I know... just store the data in the file and let SOs read them when a game is starting...
So simply said: scriptable Objects can be used when many objects behave completely the same, right?
Nice video
hey , thank u ,
The source code isn't available anymore!
So ... They are like ... Visual Lists ?
So just public class data with a prefab instance. I think I will never use them.
Speed, health, attack, damage are public values in your class. Just make a new instance and then a prefab of it. Same problem solved.
Why I can't download this awesome video for offline viewing :(
Anyways good explanation! 🙃
you can before que youtube on the link in you browser, just put a ss, like ssyoutube...
Why do they always put complicated code on their scriptable object tutorials? :( it confuses the hell out of me.
Blobs your uncle.
A bit fast. There's people who don't understand what this is.
too fast
3:34 yikes on the repeated code.