What are Scriptable Objects? (EXTREMELY Useful, Make your games Designer Friendly)

  Рет қаралды 107,457

Code Monkey

Code Monkey

Күн бұрын

✅ Get the Project files and Utilities at unitycodemonkey.com/video.php...
Let's learn all about Scriptable Objects and how they help us make our Games Designer Friendly!
👇
🌍 Get Code Monkey on Steam!
👍 Interactive Tutorials, Complete Games and More!
✅ store.steampowered.com/app/12...
Make your Games Designer Friendly! (Scriptable Objects)
Grid System in Unity
• Grid System in Unity (...
Crafting System in Unity
• Minecraft Crafting Sys...
Crafting Items with Scriptable Objects!
• How to Craft Items wit...
Build Awesome Easy to Use Tools with Custom Editors!
• Build Awesome Easy to ...
If you have any questions post them in the comments and I'll do my best to answer them.
🔔 Subscribe for more Unity Tutorials / @codemonkeyunity
See you next time!
📍 Support on Patreon / unitycodemonkey
🤖 Join the Community Discord / discord
📦 Grab the Game Bundle at unitycodemonkey.com/gameBundl...
📝 Get the Code Monkey Utilities at unitycodemonkey.com/utils.php
#unitytutorial #unity3d #unity2d
--------------------------------------------------------------------
Hello and welcome, I am your Code Monkey and here you will learn everything about Game Development in Unity 2D using C#.
I've been developing games for several years with 7 published games on Steam and now I'm sharing my knowledge to help you on your own game development journey.
You can see my games at www.endlessloopstudios.com
--------------------------------------------------------------------
- Website: unitycodemonkey.com/
- Twitter: / unitycodemonkey
- Facebook: / unitycodemonkey

Пікірлер: 182
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Scriptable Objects! Have you used them? They have so many awesome possible uses! 🌐 Have you found the videos Helpful and Valuable? ❤️ Support on Patreon www.patreon.com/unitycodemonkey or get the Game Bundle unitycodemonkey.com/gamebundle.php
@matrettr8037
@matrettr8037 3 жыл бұрын
After this video i will use them at 100%. Nice video like
@waterfan3399
@waterfan3399 3 жыл бұрын
Hey, I saw that you are online. Please make a series on C# for Unity in which you may tell about commands like addforce etc. Please make a playlist.
@GameDevExperiments
@GameDevExperiments 3 жыл бұрын
You explained it very well. I made a tutorial series for a Turn-Based RPG like Pokemon, where I stored the data of pokemons and their moves using scriptable objects. Now, I can point people who are unfamiliar with it to this video, so they can understand the basics before following my series.
@huyopo
@huyopo 3 жыл бұрын
Scriptable Objects can not only store data, they can also used for things like communication between entities. Its often a better alternative to use scriptable objects than to use Singletons (witch you shouldn't use that much, only in really rare circumstances, some say you shouldn't use them at all). Also, ScriptableObjects can contain logic. If you make them abstract, you can use derived scriptable objects to implement the logic of a gameobject. Its more flexible than using different MonoBehaviours and you can hot swap behaviours without destroying and replacing MonoBehaviours.
@dmytrosavostianov3055
@dmytrosavostianov3055 3 жыл бұрын
Duuuuuude, firstly you save me with your DOTS videos, now you do with this one! Muuuuch love for you!
@harrison298
@harrison298 2 жыл бұрын
This is the only tutorial I've seen that actually made a distinction between the Scriptable Object Definition, and the Scriptable Object asset files that are instances of it. Everyone just refers to all of the various files as "Scriptable Objects" which was really confusing to me at first.
@xkittencatx
@xkittencatx 3 жыл бұрын
I loved how you explained it! It made it very easy to understand! I think I can use Scriptable Objects a little bit more intuitively now; when I first read about them they seemed SO complicated!
@KrazyKain
@KrazyKain 3 жыл бұрын
I'm really going to have to rethink how my rpg engine handles characters and items after watching this :D
@laodes
@laodes 3 жыл бұрын
Yes. This. I always find a new way to refactor everything and If I can manage the transition it always makes further extension easier.
@laodes
@laodes 3 жыл бұрын
But I've never managed the transition successfully. Something always ceases to work and have to reimplement.
@mattjclay
@mattjclay 3 жыл бұрын
I started using them for everything. It makes everything so much easier.
@danieloxor
@danieloxor 2 жыл бұрын
Yup, sounds perfect for player statistics, quests, inventory, loottables and so on :D
@RicardoVelozo
@RicardoVelozo 3 жыл бұрын
oh man... been following and supporting your work for months now and finally I decided to slow the video intro down to 50%, because it was getting to me how your into says "inept" tutorials .... not only now I know that you mean "In depth" but the best part is how you sound at that speed! Thank you and keep up the awesome work!
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Hehe yeah it sounds a bit off but it is supposed to be in-depth, maybe I should change it to "detailed tutorials" Glad you like the videos!
@mitchelstanley5841
@mitchelstanley5841 3 жыл бұрын
Ha, that's funny - I too thought it was "inept tutorial" as a joke.
@pamalott5
@pamalott5 3 жыл бұрын
Oh I waited so long for this!😊
@nanito0071
@nanito0071 3 жыл бұрын
your videos are a huge help to my videogame, ill try to support in every way i can. Thank you!
@skye734
@skye734 3 жыл бұрын
Man you're really doing great job!!!You are using your time and skills to make our journey easy.Huge Respect and love for you.🤗
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Thanks! I'm glad you like the videos!
@arcday4281
@arcday4281 3 жыл бұрын
Cool! As always. We are looking forward to the next video.
@dspartan007
@dspartan007 3 жыл бұрын
Definitely gonna give this a try some day. Thanks, very useful video, as always.
@rickloyd8208
@rickloyd8208 3 жыл бұрын
Really awesome video and good tip regarding SO are sent by reference. That will definitely save the memory. Cannot wait to see next part about custom editor. That makes scriptable objects ideal for custom Editor tool! Thanks for you job and sharing your experience with us!
@mrbananaman8032
@mrbananaman8032 3 жыл бұрын
Yes but this actually a bad thing if you want to be able to enhance an item or ability only for one player or enemy, not all of them
@halivudestevez2
@halivudestevez2 Жыл бұрын
the cleanest explanation and demo, thank you!
@CyberStudios
@CyberStudios 2 жыл бұрын
Thank you for this! I have been binge-watching all your videos.
@CodeMonkeyUnity
@CodeMonkeyUnity 2 жыл бұрын
I hope you liked them! Thanks!
@algs5483
@algs5483 3 жыл бұрын
Thanks. I really needed a good tutorial/ lesson. And you alwalys ( or almost alwalys) do so.
@b5fan504
@b5fan504 6 күн бұрын
Still the best video on this topic to be found anywhere.
@lanceroygames
@lanceroygames Жыл бұрын
Thanks this helped with some data issues I was having when changing scenes. I needed the data to persist through scene change, but I needed it to reset upon starting the game. Seemed like Scriptable Objects are the solution!
@CodeMonkeyUnity
@CodeMonkeyUnity Жыл бұрын
That is one approach, just be careful you fully understand how persistence works with regards to scriptable objects. They will act persistent in the Editor but not in a Build unitycodemonkey.com/video.php?v=5a-ztc5gcFw unitycodemonkey.com/video.php?v=CjJNeyyhsKs
@arrain4737
@arrain4737 3 жыл бұрын
I've never worked with scriptable objects. I would say let's expand our horizon! :)
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
🌍 Get Code Monkey on Steam! 👍 Interactive Tutorials, Complete Games and More! ✅ store.steampowered.com/app/1294220/
@sekker2k446
@sekker2k446 3 жыл бұрын
I love your videos. Simple you are the best.
@Gonzakoable
@Gonzakoable 3 жыл бұрын
One quick thing, they can also be other stuff than just data. A scriptable object is pretty much the same as a monobehavior but without an update method
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Yup, I plan to explore using Scriptable Objects for handling logic in a future video
@matrettr8037
@matrettr8037 3 жыл бұрын
Can you please make some more advanced tutorial in bolt? Like for crafting system or inventory.
@RodsOnly1
@RodsOnly1 3 жыл бұрын
i can't wait for the steam app!!!!
@preflopstore9718
@preflopstore9718 3 жыл бұрын
Fantastic Tutorial!
@supertenchoo4271
@supertenchoo4271 3 жыл бұрын
thank you so much new thing added to my back pack
@hhgnehcom7672
@hhgnehcom7672 2 жыл бұрын
Hi Im doing a Card game,and I store Magic card(just run the method of that card then it destroy) method by ScriptableObject, but Its ugly to write a if Or switch(just traverse all type of magic card) method in ScriptableObject ,Is any way to just hook different method in inspector like Enum
@strooja9032
@strooja9032 3 жыл бұрын
Thanks for this awesome video. I have one little question. If i use a scriptable object for an object(for example bottle of water) and i buy three of them in the game. I can't store the amount in the scriptable object ,right? Because then it will overwrite the asset. How would you save the amount of the item? Thanks again for you great videos and i am looking forward to everything on this channel.
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
You would create an Item class that would hold a reference to the ItemScriptableObject as the type and a simple int amount. Stay tuned for tomorrows video where I will cover exactly that.
@ZiplawDev
@ZiplawDev 3 жыл бұрын
Can you make a video on Graph View? There's basically no videos online on the topic (or at least ones that explain the API step by step) It's the API that shadergraph uses, and it'd be really useful for dialogue systems for example
@r1pfake521
@r1pfake521 3 жыл бұрын
Check this kzbin.infovideos there are some videos about Graph View they show everything you need to get started. Should be easy enough to create your own dialog editor after watching these videos.
@santiagogonzalez7291
@santiagogonzalez7291 3 жыл бұрын
What keyboard do you use? Or at least what color keys. The key sound is very good XD
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Not sure, I've had it for 10+ years, it's a Samsung something
@omoloni
@omoloni Жыл бұрын
one from of bests channels
@dasmaffin1633
@dasmaffin1633 2 жыл бұрын
When I use a scriptable object, and change a value (like "isHeld"), then it changes that for the prefab of it, and not for the instance. How do I fix that?
@HuGGmaN
@HuGGmaN 3 жыл бұрын
Hi, here is a question of something i can't find. Is there anyway to drag and drop an image INGAME, recognizing the 3d object more closest to the drop site and changing the skin of the object for the imported image?
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
When you release the mouse, fire a Raycast and if it hits something get that renderer and change the material. You need to break that problem down into simpler parts, first handle dragging and dropping, then identify whats under the mouse, and lastly change the material.
@r1pfake521
@r1pfake521 3 жыл бұрын
Do you mean drag & drop the image ingame from for example a ingame menu or from the outside of the game for example from the PC desktop or folder?
@HuGGmaN
@HuGGmaN 3 жыл бұрын
@@r1pfake521 Exactly
@HuGGmaN
@HuGGmaN 3 жыл бұрын
@@CodeMonkeyUnity Thanks for the answer, i'll try that part, but idk how the program will recognize the image and import it :(
@KM-zd6dq
@KM-zd6dq Ай бұрын
Great video, if you use "will not/will" instead of "wont" it will make it even better
@r1pfake521
@r1pfake521 3 жыл бұрын
Can you make a video about the TreeView Editor with basic editing features (like undo/redo and drag&drop to move the nodes up/down). Or can someone post me a link to some other video which shows these features, because I couldn't find any. Im not even sure about the current TreeView situation because it looks like they will make a new TreeView with the new UIElements API, but im not sure if it is already out or not, because I asked in the Unity forum and they sent me github links which are either dead or private and I didn't get any other answer from them yet.
@McFlyT28
@McFlyT28 3 жыл бұрын
Watching this video, I can't help but think of well this would apply to RPGs
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Yup, RPGs are full or data so this is extremely useful
@davidcalderwood7041
@davidcalderwood7041 2 жыл бұрын
Is it possible to nest scriptable objects? For example I am working on weapon rarity in my game. So would it make sense to have a scriptable object for each type of weapon rarity? Legendary vs Common weapons vs any other rarity. I want all weapons of the same rarity to have certain things in common, like the weapon card and color base. Should those be scriptable objects that I then drag onto each weapon scriptable object? Or what would be the best way to set that up?
@CodeMonkeyUnity
@CodeMonkeyUnity 2 жыл бұрын
Yup you can make a scriptable object to define the rarity and a weapon scrpitable object that has a field for that rarity. That would be a good way to do it.
@mehmedcavas3069
@mehmedcavas3069 3 жыл бұрын
Please make the video with a custom editor. Maybe you could also make a video with this scriptableobject custom editor to make levels. Like a 32x32 grid system where we can paint levels on the SObject and create the level by reading the data. Like making a texture2d based level editor but one which is dynamic
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Yup I covered Custom Editors here kzbin.info/www/bejne/mH7YhaZ3osZnqs0 And here kzbin.info/www/bejne/qIGleoaGr9Kbpck I'll be using that in the next video to make a custom editor for the Crafting Recipes. Making a Scriptable Object to hold Level Data would be a great example project, I'll look into it, thanks!
@pistoleta
@pistoleta 3 жыл бұрын
The only things that annoys me is how they keep the runtime changes when running on editor. Changes dissapear after restarting unity but sometimes is a hustle specially if youre using Unity Collab
@mcbvideogames
@mcbvideogames 3 жыл бұрын
Question! I am making a game which has a set of spells. I didn't know of ScriptableObjects beforehand, so what I did is: I created an abstract SpellBase class script (extending monoBehaviour). It contains common attributes between spells, such as name, description, cost, and cooldown, and an abstract void (UseSpell()). For every new spell script, it extends said SpellBase, adds new atts if necessary, and implements the UseSpell() void. Lastly, a SpellManager script, which makes a List out of all Spells, excluding SpellBase, and on certain key presses cycles thtough the list, and when pressing another key, will trigger the selected Spell's UseSpell() void. Is scriptableObject worth extending instead of monoBehaviour? If so, how can I retain this hierarchy without making a drastic change in code?
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
You can just swap our MonoBehaviour for ScriptableObject and everything will work mostly the same, only difference is functions like Start() and Update() wont be called automatically. Having a Scriptable Object for each spell type and and making Scriptable Objects for each spell action is indeed a valid way to go
@mcbvideogames
@mcbvideogames 3 жыл бұрын
@@CodeMonkeyUnity Hey, thanks for your reply! Unfortunately, I have run into a bit of a problem. Scriptable Objects can't reference scene assets, so my healing spell gets a nullPointerException when trying to interact with the healthbarManager script. Any ideas on what should I do?
@rickloyd8208
@rickloyd8208 3 жыл бұрын
I have a question, what makes scriptable object more attractive than public properties of the component? They are both editable... the only advantage I see is that scriptable objects could be places in some config folder and designer may not need to search to which object the controller component is assigned (I saved your video and liked in advance, I will watch it tomorrow, sorry if you answered this question within video)
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
The main point is they are stored as asset files in your project. They have the same type but different data. So a programmer can create the scriptable object definition for a weapon and make the game work with that definition and then a designer can very easily create more weapons by just creating more objects and setting their data. What you're describing would be doable with a Prefab and a script attached to it, but at that point you have exactly a scriptable object but in a more dirty way. In the next video I will cover a use case of adding SCriptable Objects to the Crafting System
@rickloyd8208
@rickloyd8208 3 жыл бұрын
@@CodeMonkeyUnity Thank you so much for your awesome videos! I will watch this video and the next one =) So may be I will come back with some clarification questions later!
@RandomShowerThoughts
@RandomShowerThoughts Жыл бұрын
@@CodeMonkeyUnityah this definitely makes a ton of sense
@anonymoussloth6687
@anonymoussloth6687 3 жыл бұрын
Please correct me if I am wrong: so the benefit of scriptable objects is suppose I have and an enemy script that is attached to each enemy in my game. That script will have data like sprites, animations, etc which are the same for all enemies but because each script is attached to a gameobject, it will create duplicates of that data. However, with scriptable objects, I can create only one container for that data and use that to reference the data in each enemy script. That will in turn save memory. Correct?
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Yes, although not everything stored in a MonoBehaviour will be duplicated, only value types kzbin.info/www/bejne/gXipcqGtoLRjhs0
@FM_GOBi
@FM_GOBi 3 жыл бұрын
I love your videos man!! How come you like saying "yup" so much?
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
No idea, it just sounds good! I like constantly testing and verifying that the code works so I ended constantly running the game and going "yup the code runs!"
@FM_GOBi
@FM_GOBi 3 жыл бұрын
@@CodeMonkeyUnity Thank you for the tutorials. I always watch them with my Evernote on the other monitor, so I can take notes. It's a huge help. Good luck with your work!
@lollol-zk8dh
@lollol-zk8dh 3 жыл бұрын
Is this possible to be made in say like roblox? which uses LUA
@WelbyCoffeeSpill
@WelbyCoffeeSpill 3 жыл бұрын
So many questions! Lol. If it is a reference to the SO,..and three orcs get a sword item SO, but only one Orc uses the sword and decreases its "durability" stat , will that alter the other two sword's durability?
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Yes Scriptable Objects are meant for shared data, in your case you would either store the durability in a different way, like as a member variable in each Orc script, or instantiate a new Scriptable Object for each Orc.
@mrbananaman8032
@mrbananaman8032 3 жыл бұрын
@@CodeMonkeyUnity this is exactly why I dont get the point of SOs. Why would I ever want to save every enemy's weapon to disk? Its like a weird niche way of saving your game data if something happens to be an object, yet you'll still have to save everything else in a typical fashion anyways. Another way to look at it is that a SO really wants something to be an object (a sword here), yet in this orc example, you have to remove critical aspects of it like durability from the item and put it somewhere else. This just makes my brain twist in half.
@WelbyCoffeeSpill
@WelbyCoffeeSpill 3 жыл бұрын
Also,..not sure I want like 80 item objects filling up my project directory. I usually do the excel csv thing. And store new instances of 'item' in a list. I don't understand the big advantages,...yet, to be honest. I guess editing is easier?
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
If all you have is text then yes using a Excel spreadsheet would be better. But if you have a more complex data structure where you want to store text and images and videoclips and anything else then scriptable objects are very useful. In the next video I'll show a use case of applying this to the Crafting System
@sundarakrishnann8242
@sundarakrishnann8242 3 жыл бұрын
Hey! Is it possible to create stuff like rogue like generation using bolt? If yes, it would be cool if you could make a tutorial on it!
@sundarakrishnann8242
@sundarakrishnann8242 3 жыл бұрын
@@bezoro2008 hi ! Thanks a lot for your reply...i was just learning about rogue like generation and hence I got a doubt if it could be implemented in bolt..since bolt became free I just had a thought of using it..anyway thanks for thr reply..
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Sure it's possible, if you go the simple route of just having a bunch of premade level sections and randomly placing them to build your level it can be quite easy. If you want to go more complex it becomes more difficult and the more complex you go the easier it becomes to do it through code.
@sundarakrishnann8242
@sundarakrishnann8242 3 жыл бұрын
@@CodeMonkeyUnity thanks a lot sir! You have replied exactly what I had wanted to know😊( about which could be preferred)...Again thanks a lot!
@anonymoussloth6687
@anonymoussloth6687 3 жыл бұрын
I am using scriptable objects to create different types of guns and store some data about them. Also, I am using your concept from the interface video to make a IGun interface and have a shoot function in it. The only issue now is how do I make scriptable object have a function that is specific to that gun so that in the main game program, i just need to pass a IGun variable and call the shoot function?
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
That depends on how you handle shooting. Is it spawning a bullet prefab? If so you can store it in the scriptable object. Or do you need to do some complex logic that is not just data? If so then you need to write that code somewhere, maybe do a switch on a WeaponType run that code. It all depends on if you can abstract your shooting logic so that it is fully data driven.
@anonymoussloth6687
@anonymoussloth6687 3 жыл бұрын
@@CodeMonkeyUnity I use raycasts to do shooting and each gun has a different shoot method depending on different logic that is related to their data such as range, fire rate, is automatic, etc. Currently I have a unity event in my scriptable object to which I have linked each of the shoot functions of the gun but I was wondering if there is a better way to do this
@TinyDeskEngineer
@TinyDeskEngineer 2 жыл бұрын
70% of the projects I've started since learning how to use scriptable objects use scriptable objects for basically every single thing out of the still very small amount of things I did
3 жыл бұрын
Eu gosto dessa prática. Muitos pensam nela como uma forma de facilitar a configuração de objetos, mas como apontado em 7:45, isso é bem útil para ter um melhor uso de memória. Como sempre, um ótimo vídeo.
@superdahoho
@superdahoho 15 күн бұрын
hi code monkey, can you do a tutorial on how to make abilities with scriptable objects that have unique functions? I've seen several videos on youtube but they way everything is set up, each new ability is a new KIND of scriptable object. if you were to have 100+ different skills, it takes up so much space in the editor, it's hard to organize them. because when a SO is made, you cannot go in to override the function, therefore each SO has to be it's separate entity. I've been stuck on this for quite some time now.
@CodeMonkeyUnity
@CodeMonkeyUnity 13 күн бұрын
If you have custom logic then one option is indeed like that, make a new type of scriptable object that contains the logic for that new skill Alternatively you could have a that takes in a scriptable object, checks the type and does the specific logic for that object. But in that case you then have logic separate from the scriptable object Yet another option is to go with a much more modular system. Make a scriptable object type for each "effect". Like "projectile", "fire", "dealsDamage"; where each of those would have that logic, and then you construct your skills by composing those different scriptable objects in some array inside the main skill scriptable object. I covered a modular character controller that might help point you in that direction kzbin.info/www/bejne/o3u1lGyhgd15ic0 Or simply use Interfaces with default function implementations, that way you don't need to write tons of code for each SO, just implement the interface, which can make it simpler. But whatever option you choose you are always going to have some amount of complexity if you want hundreds of skills, there's really no special pattern that makes a system like that super simple, just more manageable
@Juan-lj4pi
@Juan-lj4pi 3 жыл бұрын
By any chance are you going to make a IEnumerator tutorial? either way, thanks a lot, I've learn a lot from your videos :)
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
I'm usually not a fan of Coroutines but it is a subject I should probably cover sometime
@hawns3212
@hawns3212 3 жыл бұрын
@@CodeMonkeyUnity Why are you not a big fan of them? Is it a specific reason or just habit?
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
@@hawns3212 Just because they force you to use a very specific pattern of returning IEnumerator, doing yield returns and using a GameObject, that's not something I use anywhere else in my codebase
@Andrew90046zero
@Andrew90046zero 3 жыл бұрын
I wish unity could redo the "asset creation context menu" so it would be more like the "add component menu" that you can search and it oly displays 1 tree layer at a time. That would make scriptable objects way much better. I use Odin Inspector, and I found this script that one of the devs of Odin released where It creates a "super list" of all of the scriptable objects regardless of it having a "CreateAssetMenu" attribute. So you can just search it up and create it, much smoother workflow. Also, I'm afraid to click the like button 😬 666 likes lol
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Yeah that menu does start to become massive as you add more packages, making it like the component menu would be great
@farfi55
@farfi55 3 жыл бұрын
can you link please?
@Andrew90046zero
@Andrew90046zero 3 жыл бұрын
@@farfi55 If you're talking about that scriptable object script thing. Yes. I actually had to dig for the original link for a minute. And it turns out there is a list of different custom scripts on their website. odininspector.com/community-tools/540/scriptableobject-creator odininspector.com/community-tools
@EDMFanChannel
@EDMFanChannel Жыл бұрын
You can make video about ScriptableObject + Tile map , Please!
@sundarakrishnann8242
@sundarakrishnann8242 3 жыл бұрын
What is the library (using CodeMonkey.utils) which is seen in many videos? How did you create? Is there a video on it?
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
There's no video but you can download the complete package with all the source code and inspect it all yourself
@aboukris
@aboukris 3 жыл бұрын
Hi @CodeMonkey I tried to register on your site, the sending configuration email does not work please check
@y01cu_yt
@y01cu_yt 6 ай бұрын
Thanks!
@user-vs7qg8vi2d
@user-vs7qg8vi2d 3 жыл бұрын
What unity are you using? Unity hub? Or some other unity? And where do i have to go to find the script programming place that you are using right now? :D
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Unity Hub is simply the program to manage all your Unity versions and projects, I'm using 2019.4 For the code I'm using Visual Studio Community
@user-vs7qg8vi2d
@user-vs7qg8vi2d 3 жыл бұрын
@@CodeMonkeyUnity thank you!
@p1no_839
@p1no_839 3 жыл бұрын
Do you think it's a good idea for a beginner to copy code from stack overflow until you learn them?
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
It's definitely a good idea to use stack overflow to help you solve your problems, but when you find the solution don't just blindly copy it. Instead take the time to understand why it works.
@nohypelarx
@nohypelarx 3 жыл бұрын
CodeMonkey: Can I use scriptable objects to change your simple SpriteAnimator animations at runtime. If not how could I dynamically change de sprites that can be played by the SpriteAnimator? Let say i have idle and walk animations for a unit and play them with the simple Sprite Animator from your video but i want to change the sprites of each animation at runtime to show other unit skin
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Sure, that sprite animator is just an array of Sprites so you can store the array of sprites in the ScriptableObject and modify the sprite animator to read the array from the scriptableobject instead of its own field.
@nohypelarx
@nohypelarx 3 жыл бұрын
​@@CodeMonkeyUnity I would like to create something similar to what you do in Simple Turn Based RPG of changing the sprites and animations on runtime. Thanks for answering. I really like your tutorials
@brockormond4131
@brockormond4131 3 жыл бұрын
So a couple of questions... 1) Does scriptable objects ONLY contain data? Meaning they can't run any method calls on their own... if so, 2). Can scriptable objects be useful in conjunction with ECS?
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
They can have methods as well, I'll cover an example of that in the next video when I add them to the crafting system. Sure, they can be used in ECS, you just need to grab the reference somehow and then you can use them for whatever you want. Although keep in mind they are objects used by reference, not value structs.
@chuckdude514
@chuckdude514 6 ай бұрын
I don't like them that much because they feel like singletons. For instance, in the enemy weapon example you mentioned, if I were to modify the damage of the weapon of a single enemy (weapon curse debuff or something), every other enemy holding that weapon would also be affected. However, just like singletons, if you plan ahead and know in what ways your game might be extended, then you are good to go.
@CodeMonkeyUnity
@CodeMonkeyUnity 6 ай бұрын
My general rule is to only ever use Scriptable Objects for static data. So in that case I would store the weapon base damage in the SO, but for any modifiers I would store them in the enemy/weapon instance and would not modify the SO at all
@chuckdude514
@chuckdude514 6 ай бұрын
@@CodeMonkeyUnity Yeah, that's a nice way of putting it into words and a good example of planning ahead! In my current case, I searched for this video because I was thinking of using SO's to create string managers (one instance to save keys for ES3/PlayerPrefs, another to store tags, and so on). This way, I will be able to keep the codebase more modular, rather than using a MonoBehaviour singleton that can be referenced by any system at any time.
@marushirudesu
@marushirudesu 3 жыл бұрын
Should i use Scriptable Objects when it comes to individual ability of the enemies? or I use Inheritance instead
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Both approaches are valid depending on your particular case. do a quick prototype to test both methods.
@marushirudesu
@marushirudesu 3 жыл бұрын
@@CodeMonkeyUnity woah ,thanks brother
@thg1nrediar
@thg1nrediar 2 жыл бұрын
Thanks
@lokosstratos7192
@lokosstratos7192 5 ай бұрын
what does onbeforeserialization/onafterserialization mean in scriptableobjects? i dont understand the whole concept of serialization
@CodeMonkeyUnity
@CodeMonkeyUnity 5 ай бұрын
Serialization is basically taking the scriptable object with all it's data and converting it into a format that is saved. For example JSON serialization converts it into a JSON string. Those functions run before or after that process happens You don't really need to use them unless you're making some really custom logic where you want to process some data in some special way before/after Unity does the default serialization
@lokosstratos7192
@lokosstratos7192 5 ай бұрын
@@CodeMonkeyUnity can you help me understand it a bit deeper. when does the serialization process happen? is it when we create a scriptableobject in our asset folder? or when its instantiated in the game ? Im using dictionaries and i need to have isrealizationcallbackreceiver to get an id for the SO Im using a SO for my inventory and SO for my inventory items so the id reference changes. it becomes a bit tricky to save scriptable objects within a scriptable objects
@gower1973
@gower1973 3 жыл бұрын
So it’s just like a struct or class with just member variables and no methods?
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
The main point is that it's an asset stored in your project files. It can be used for data but it can also hold logic, you can add any type of functions you want. I'll cover that a bit in the next video when I add Scriptable Objects to the Crafting System.
@mrbananaman8032
@mrbananaman8032 3 жыл бұрын
Yeah, I still don't understand the advantage over the added complexity. I don't understand what problem SO's fix besides being able to let non programmers mess with item stats in the UI or something.
@silverdragon711
@silverdragon711 25 күн бұрын
@CodeMonkeyUnity - In your current tutorials you mention always making things private. Is that not true in a scriptable object?
@CodeMonkeyUnity
@CodeMonkeyUnity 24 күн бұрын
Yup scriptable objects are the exception, the reason being because I only ever use them as read-only data containers, I never modify them. However scriptable objects do not enforce that rule, that's just a personal rule that I follow, if it's public you can write to it which might break all sorts of things. So if you don't trust yourself to manually follow that rule or if you work as part of a team and aren't sure if everyone is going to follow it, then you can indeed make them private and expose Get() functions like for normal fields.
@nosamyd9474
@nosamyd9474 3 жыл бұрын
im pretty new to unity i mean by this is posted unity isnt even installed yet! gimme some uhhh idk?
@arcday4281
@arcday4281 3 жыл бұрын
Hello everyone Tell me how to make it easier and more practical: data Exchange between scripts. For example: Get position(). Create a script containing all the others-inheritance - get-set...? Use interfaces for each necessary function ? Or are there other options ?
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
You could implement an interface, IHasPosition then implement GetPosition() => transform.position That's what I used in some scripts on Battle Royale Tycoon
@arcday4281
@arcday4281 3 жыл бұрын
@@CodeMonkeyUnity Thanks a lot. I'm still surprised by your superpower to respond to all subscribers)) It probably takes so much time...
@kingofgame2762
@kingofgame2762 3 жыл бұрын
Please tutorial for unity particle system 2d and if the video 2 hours I will watch the video
@Igor-rd2fb
@Igor-rd2fb Жыл бұрын
Greetings. How do I reset ScriptableObjects after each play?
@CodeMonkeyUnity
@CodeMonkeyUnity Жыл бұрын
You should never modify them so they should never need to be reset.
@mr.jsingh2384
@mr.jsingh2384 3 жыл бұрын
Are you not going to make bolt tutorials
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Yup, I'm working on more Bolt videos
@callmedeno
@callmedeno 2 жыл бұрын
So they aren't really designed for setting up references between objects?
@CodeMonkeyUnity
@CodeMonkeyUnity 2 жыл бұрын
Depends if the object exists in the scene or as a prefab, you can reference prefabs since those are not connected to any scene
@watercat1248
@watercat1248 11 ай бұрын
In my opinion scriptable object is just Data based I don't even know why they called scriptable object But i discover recently the nested scriptable object and I'm curious what is the difference and how this new type I will be useful
@AsasinoManik
@AsasinoManik 3 жыл бұрын
I am a designer myself, so I just clicked it.
@nosamyd9474
@nosamyd9474 3 жыл бұрын
(laughing noises here) WHAT A GOOD COMEDIAN! 10 OUT OF 10!
@thehacknologist1692
@thehacknologist1692 3 жыл бұрын
Can you make a game with bolt in unity.
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Sure, Bolt is extremely powerful and you can build anything with it
@giangbuitam4868
@giangbuitam4868 3 жыл бұрын
can i change the data of scriptable objects in run time ?
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Yup, but be careful of the issues I mentioned regarding Editor saving vs Standalone saving
@giangbuitam4868
@giangbuitam4868 3 жыл бұрын
Code Monkey how can i change data of them ? I don’t know how to do that
@Alzimovich2
@Alzimovich2 3 жыл бұрын
@@giangbuitam4868 Never used SO, but they are simply scripts with public fields... so I assume SOinstanceName.fieldName = newValue; should do the job.
@osmanpekaydn4070
@osmanpekaydn4070 3 жыл бұрын
I don't understand differance between structs and scriptable objects
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
A Scriptable Object is an asset that stores data and lives in your project files. A Struct can store data in memory
@sudhanshlone8284
@sudhanshlone8284 3 жыл бұрын
Is using scriptable objects more performant?
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Really depends on the situation. For example if you have tons of duplicated memory in use and you replace that with Scriptable Object references then yes. But in general they are not necessarily more performant by default, it all depends on what you're doing and your implementation.
@johnpatrickjuni945
@johnpatrickjuni945 3 жыл бұрын
Pls help me I'm just a student and know very little (almost nothing) about programming can you help me where to start, I'm just starting so pls help.
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Learn the Basics of Unity here kzbin.info/www/bejne/e2ekZYqsqKmYgqc And C# Basics here kzbin.info/www/bejne/f3fEqoSfpKxqZ6M
@johnpatrickjuni945
@johnpatrickjuni945 3 жыл бұрын
@@CodeMonkeyUnity thanks
@topievan190
@topievan190 3 жыл бұрын
Indonesia here
@nahulseyon54
@nahulseyon54 3 жыл бұрын
3nd like 3rd view 3rd comment and 3rd party...😆😆😆 Bro how to patch an app using lucky patcher? Plz tell me if any one knows.
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
That's a pretty complex topic, you should probably let someone else like Steam or the AppStore handle versioning and updates.
@shalihrizal9433
@shalihrizal9433 3 жыл бұрын
Well, kinda shocked to see the .ass extension at the thumbnail xD
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Oh yeah I guess in some cases the time overlay will obscure the text
@bilbostabbins1882
@bilbostabbins1882 3 жыл бұрын
@@CodeMonkeyUnity mmmmm .ass ets, Liked and Subscribed!
@Naufal12948
@Naufal12948 3 жыл бұрын
Why untity not in phone
@zed538
@zed538 3 жыл бұрын
HI there folks
@myelinsheathxd
@myelinsheathxd 3 жыл бұрын
another level of json file😉.......
@JoligonOne
@JoligonOne 3 жыл бұрын
Please Dotween video
@andylockhart257
@andylockhart257 3 жыл бұрын
Debug.love()
@eduardo-cat
@eduardo-cat 3 жыл бұрын
1 view :0
@semithegamedeveloper6995
@semithegamedeveloper6995 3 жыл бұрын
i want to become a proffesional indie developer. do you believe me?
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Go for it!
@semithegamedeveloper6995
@semithegamedeveloper6995 3 жыл бұрын
@@CodeMonkeyUnity You are best youtuber in world. there is no youtuber answering the comments.
@Pedro_Marangon
@Pedro_Marangon 3 жыл бұрын
First!
@carlabalos3884
@carlabalos3884 Жыл бұрын
Thanks!
How to Craft Items with Scriptable Objects! (Unity Tutorial)
19:46
What are Interfaces? (C# Basics)
13:54
Code Monkey
Рет қаралды 200 М.
WHY IS A CAR MORE EXPENSIVE THAN A GIRL?
00:37
Levsob
Рет қаралды 16 МЛН
ONE MORE SUBSCRIBER FOR 6 MILLION!
00:38
Horror Skunx
Рет қаралды 14 МЛН
Secrets to a Great Platformer Character with Unity
3:11
Dawnosaur
Рет қаралды 53 М.
Scriptable Objects: What are they? How do you use them?
10:38
Better Data with Scriptable Objects in Unity! (Tutorial)
5:12
Modular Character System in Unity (Move, Attack, AI, Pathfinding)
21:16
Rethink Everything with Scriptable Object VARIABLES
15:28
The Power of Scriptable Objects as Middle-Men
17:41
samyam
Рет қаралды 116 М.
Unity Code Optimization - Do you know them all?
15:49
Tarodev
Рет қаралды 181 М.
ScriptableObject в Unity на примере информации о сундуках
10:05
Лавка Разработчика
Рет қаралды 18 М.