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

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

Code Monkey

3 года назад

108,209 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Water Cat
Water Cat - 09.07.2023 07:05

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

Ответить
Lanceroy
Lanceroy - 10.02.2023 00:01

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!

Ответить
ОМОЛОНЬ
ОМОЛОНЬ - 22.09.2022 14:31

one from of bests channels

Ответить
Péter N.
Péter N. - 18.09.2022 10:34

the cleanest explanation and demo, thank you!

Ответить
Igor
Igor - 15.08.2022 00:36

Greetings. How do I reset ScriptableObjects after each play?

Ответить
Carl Abalos
Carl Abalos - 30.07.2022 08:42

Thanks!

Ответить
EDM Fan Channel
EDM Fan Channel - 17.06.2022 11:07

You can make video about ScriptableObject + Tile map , Please!

Ответить
Sr. Glitcu
Sr. Glitcu - 20.05.2022 20:16

Thanks

Ответить
DasMaffin
DasMaffin - 06.04.2022 12:48

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?

Ответить
callmedeno
callmedeno - 25.02.2022 12:39

So they aren't really designed for setting up references between objects?

Ответить
David Calderwood
David Calderwood - 16.01.2022 19:34

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?

Ответить
Harrison
Harrison - 09.12.2021 19:16

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.

Ответить
Tiny Desk Engineer
Tiny Desk Engineer - 08.10.2021 01:20

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

Ответить
hhgnehcom
hhgnehcom - 16.08.2021 20:27

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

Ответить
NayNay ZA
NayNay ZA - 10.08.2021 13:32

Thank you for this! I have been binge-watching all your videos.

Ответить
❤️KittenCat❤️
❤️KittenCat❤️ - 10.06.2021 09:03

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!

Ответить
Captain Nemo
Captain Nemo - 03.06.2021 14:46

What an annoying voice!

Ответить
StenBone
StenBone - 13.05.2021 04:08

Watching this video, I can't help but think of well this would apply to RPGs

Ответить
BatteryBoy
BatteryBoy - 21.02.2021 19:22

im pretty new to unity i mean by this is posted unity isnt even installed yet! gimme some uhhh idk?

Ответить
Angelo Bazar
Angelo Bazar - 29.11.2020 16:59

Should i use Scriptable Objects when it comes to individual ability of the enemies?
or I use Inheritance instead

Ответить
Matren Armis
Matren Armis - 24.11.2020 12:15

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?

Ответить
Dmytro Savostianov
Dmytro Savostianov - 21.11.2020 12:44

Duuuuuude, firstly you save me with your DOTS videos, now you do with this one!
Muuuuch love for you!

Ответить
Anonymous sloth
Anonymous sloth - 26.10.2020 17:19

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?

Ответить
Anonymous sloth
Anonymous sloth - 24.10.2020 12:09

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?

Ответить
Osman Pekaydın
Osman Pekaydın - 19.10.2020 03:53

I don't understand differance between structs and scriptable objects

Ответить
NoHypeLarx
NoHypeLarx - 26.08.2020 07:39

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

Ответить
Devenir Pro
Devenir Pro - 15.08.2020 11:39

Hi @CodeMonkey
I tried to register on your site, the sending configuration email does not work please check

Ответить
Andrew900460
Andrew900460 - 09.08.2020 22:51

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

Ответить
Preflop Store
Preflop Store - 05.08.2020 01:33

Fantastic Tutorial!

Ответить
ShalihRizal
ShalihRizal - 03.08.2020 15:44

Well, kinda shocked to see the .ass extension at the thumbnail xD

Ответить
Rai 2011
Rai 2011 - 03.08.2020 00:19

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

Ответить
FM GOBi
FM GOBi - 02.08.2020 22:50

I love your videos man!! How come you like saying "yup" so much?

Ответить
Sundarakrishnan N
Sundarakrishnan N - 02.08.2020 18:43

What is the library (using CodeMonkey.utils) which is seen in many videos? How did you create? Is there a video on it?

Ответить
p1no_
p1no_ - 02.08.2020 08:55

Do you think it's a good idea for a beginner to copy code from stack overflow until you learn them?

Ответить
Game Dev Experiments
Game Dev Experiments - 01.08.2020 09:23

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.

Ответить
Topi Evan
Topi Evan - 01.08.2020 07:25

Indonesia here

Ответить
Rick Loyd
Rick Loyd - 01.08.2020 05:50

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!

Ответить
ARC DAY
ARC DAY - 01.08.2020 03:11

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 ?

Ответить
Ricardo Velozo
Ricardo Velozo - 01.08.2020 01:31

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!

Ответить
AsasinoManik • Insanity Crew
AsasinoManik • Insanity Crew - 31.07.2020 23:01

I am a designer myself, so I just clicked it.

Ответить
Skye
Skye - 31.07.2020 22:44

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.🤗

Ответить
Strooja
Strooja - 31.07.2020 20:34

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.

Ответить
John Patrick Juni
John Patrick Juni - 31.07.2020 16:17

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.

Ответить
Andy Lockhart
Andy Lockhart - 31.07.2020 15:53

Debug.love()

Ответить
Myelin SheathXD
Myelin SheathXD - 31.07.2020 15:18

another level of json file😉.......

Ответить
pistoleta _
pistoleta _ - 31.07.2020 14:50

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

Ответить
LT Slugg
LT Slugg - 31.07.2020 10:26

I know everyone is requesting vids from you, theres something Im really struggling with called the observer pattern. More specifically how to implement it on the UI.

If youre ever thinking of what tutorial video to do remember Codemonkey observes the observer pattern.

Ответить
huyopo
huyopo - 31.07.2020 09:36

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.

Ответить