How to use Unity's Scriptable Objects [Unity/C# 🇬🇧 tutorial]

preview_player
Показать описание
#unity #csharp #gamedev #asset #data

In this Unity tutorial, let's discover the basics of Unity's Scriptable Objects and see how this amazing tool can help us store custom data types in an efficient and flexible way :)

0:00 - Introduction
0:41 - So, what are Scriptable Objects?
2:53 - Understanding the "single source of truth"
6:27 - A basic example of data sharing
15:57 - Storing global persistent data
19:41 - Towards "data-driven" and "no-code" projects?
23:12 - Conclusion
Рекомендации по теме
Комментарии
Автор

Im really happy i found your channel, love the way your explain and your accent, ty for switching to black screen to show the code :)

carlozuk
Автор

Thank you, it's the best explanation of the ScriptableObjects that I have found.

javierfuentes
Автор

Mina you are just the best, I'm so happy i found this channel, I'm gonna learn so much! I'm so excited. I'm not just gonna learn how to programme in unity but also how to optimize my code. So so grateful. Please continue making more unity/ c# lessons, you teach so well.

LorrahNgobeni-mjmn
Автор

this has to be one ofthe best explainations and use case of scriptable objects ive found

solitarygrounds
Автор

Thanks a lot for all these clarifications !

hunabku
Автор

Thanks for the great video. I'm glad you explained all the ins and outs, like how Scriptable Objects behave differently in a final build, than in the editor.
There are many gotchas! It's quite a complex topic, with nuances to their behaviour in different situations and use cases, and choosing when and how to use them can be fiddly!

muzboz
Автор

Thanks for the great video. I really am gladd to have watched this awesome explain.

Miura-Anjin
Автор

jesus christ the explanation and use cases of scriptable objects is so well done. Even monkeys can understand it

semi_jared
Автор

I'm not exactly sure what's going on for me. Using your project as example. When i'm trying to declare a value and putting down data.XP or data.health. In return I am being told that my SO doesn't have a definition for that data? I have tried using the value as both an int and float value. declaring it at the start using health = data.health. All of which gave the same error.

Umblizm
Автор

I find it much easier having my scriptable objects in a
setup or start scene this way you can just use the objects
you want and make sure they are in the appropriate scenes

This also stops you from drag and dropping every scene you need that object

After_Pasta
Автор

Nice way of explaining SO's! I sometimes find myself over-using SO's that so many SO's to handle with. Its good for to share player's health to store it in SO. But what if we have +100 enemies that spawn in runtime. Should we create another Health system for them. This makes me feel making 2 different health system. Not using a common one

TheKrckeR
Автор

Great content! Thanks for sharing.

I'm starting to play with Unity's Scriptable Objects and I didn't consider the use of events to track data mutations, it is a nice approach. When you implement the buttons to update player data from the game logic at 13:20, it's important to invoke the update event once the data is updated in the PlayerManager class, it could be missed since that part is shown a bit fast.

Off-topic: May I ask what video editor are you using? Your videos look so clean and smooth, and I'm trying to make devlogs oriented to developers, I feel like years away from the quality of your videos 😅, thanks in advance.

AlbertoFdzM
Автор

I am having a hard time wrapping my head around this. Is it only good on variables that don't change?
For example, let's say your viking is an enemy unit and we're generating 20 of them in game for the player to fight against.
SO is good at for referencing the viking's level because instead of 20 INTs, we only need one.
But for stats that do change, say viking's HP, because player might attack different vikings at a time, there's no need to put that variable as SO. right?

superdahoho
Автор

If you wanted to pass a scriptable object to a script to have it read, how would that be accomplished? Like in an inventory system and you want to see the properties of a piece of armor or weapon.

darkman
Автор

Hello ! I'm fairly new to unity and i'm trying to create a card game. I tried scriptable objects and it works great. I just create a scriptable object card with mana, attack and health. But I have to drag and drop my scriptable objects to my gameobject script every time I create a new card. Is there a way to call a particular scriptable object card I created with for exemple an ID instead of drag and drop it on my game object ? Thanks in advance !

hiei
welcome to shbcf.ru