When making a game you need a good way of storing data. This is where Scriptable Objects come in! In this video we’ll learn how to use them by looking at an example: Making cards for Hearthstone.

● Project on GitHub:

♥ Support Brackeys on Patreon:

····················································································

♥ Donate:
♥ Subscribe:

● Website:
● Facebook:
● Twitter:

········································­­·······································­·­····

Edited by Sofibab & LeBonques.

········································­­·······································­·­····

► All content by Brackeys is 100% free. We believe that education should be available for everyone. Any support is truly appreciated so we can keep on making the content free of charge.

········································­­·······································­·­····

♪ Baby Plays Electro Games

♪ Funin and Sunin Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 3.0 License

Nguồn: https://thedancingparent.com/

Xem thêm bài viết khác: https://thedancingparent.com/game/

36 Comments

CoolMatt

July 3, 2020

cant you do the same thing with prefab

Reply

MrSirGame

July 3, 2020

This was super useful

Reply

Der Pianist

July 3, 2020

Hey, kinda new unity user here, if you were to make a pokemon kind of game, similar to older games like fire red or emerald, would you do prefab to spawn in when a battle starts or scriptable objects?

Reply

RebelOfTheWorld

July 3, 2020

Can we get a full tutorial on how to make a tcg?

Reply

Nikita Mae Harris

July 3, 2020

So this is the answer to my question that's been bugging me for days. Just figured out I cannot (properly) do constructors like in your typical C# classes because of monobehavior and I was getting a headache how to make my code cleaner.

Reply

Wuxia Novels Audiobook HD

July 3, 2020

0:18 The subtitle "Heavenly Choir" made me giggle a bit 😀

Reply

Raul Jeri Lara

July 3, 2020

Is it possible to select tirion or vadin but from a number or text? Let me explain: If you get 1 or "tirion" instead of move the scriptable Tirion to the object card. Why? because its easier to get infor only by a number or a text than find the scriptable and moving to the object.

Reply

Max Medina

July 3, 2020

Brackeys: You can easily update this while the game is running, because we're just swapping out simple information.

Me: Well… and… how do I do it?…

Reply

Vít Pokorný

July 3, 2020

Wow Brackeys allways saves my project

Reply

刘一平

July 3, 2020

simple and clear!!!

Reply

Its TTSI

July 3, 2020

Make a tutorial on radial menus

Reply

KokahZ777

July 3, 2020

Really cool video. When you drag a card in the "CardDisplay" component is it instanciated ? So you can do stuff like removing health or attack etc.

Reply

Mosopia

July 3, 2020

Unnecessary Roughness lol

Reply

YMTS_VLADYSLAV

July 3, 2020

Wouuu nicee. Your lesson really helped me out a lot , thanks)

Reply

S. W. E. D.

July 3, 2020

In case of Having a pokemon like game where you can have a LIST of all the "Pokemon" would you use a prefab or a Scriptable Object? What if the sprites are different sizes? How would the data be loaded and saved? If you make a Scriptable Object or a "Pikachu" and then catch it, and it levels up, when you encounter another "Pikachu" would they have the same stats? or saving a Scriptable Object makes a new one? Thank you for the Help.

Reply

Json ZU

July 3, 2020

Thanks that is so helpful

Reply

Kap Koder

July 3, 2020

This will save me some space, my scripted object file size is 500 bytes Vs. 7 kb when using prefabs

Reply

Matthew Brand

July 3, 2020

if I have durability on one item and i have 2 of that item how do I make them not use the same durability

Reply

Carlos Ezequiel Centurion

July 3, 2020

I never liked your videos but now i owe you one. Thanks!

Reply

Columini

July 3, 2020

Hey, I'm new to unity and game making. Could someone explain to me why prefabs are prone to errors and inconvenient?
I really like using prefabs 🙁

Reply

Freljord

July 3, 2020

they nerfed edwin, now it's 2/2 🙁

Reply

Manlok

July 3, 2020

I would like to hear about implementing complex skill interaction logic rather than just basics on organizing data members.

Reply

gambikules

July 3, 2020

but prefabs are better for cards game… you have instantly preview of your card.

Reply

Ilyas

July 3, 2020

Pause and go to 0:00

Reply

freakymundo

July 3, 2020

Can you have nested scriptable objects? or have an object contain a list of scriptable objects?

Reply

Jonny Othman

July 3, 2020

@Brackeys Thanks to your tutorials. Based on this one and your menus tutorial I've made a game based on the infamous Deck of Many Things from D&D and Pathfinder. I leave the link here so if you ever read this you can check how it came out.
https://dolmek.itch.io/deck-of-many-thing

Reply

EcoZones2D6

July 3, 2020

making duplicates with public variables doesnt make the same?

Reply

AlexTRONIC

July 3, 2020

can anyone tell me if i were to make like 3d weapons in an rpg games, are prefabs the way to go? since each weapon has its own mesh and colliders, etc.

Reply

Eduardo B. R.

July 3, 2020

Not a good practice to use the "new" keyword to override property/variable in a base class, it can lead to problems, later down the line when you really want to use the name from the base classe you can't :- do not encourage that, it's anti pattern.

Reply

p sis

July 3, 2020

brigada meu rei

Reply

Nathan Ellis

July 3, 2020

So it’s a model ?

Reply

Scott_33

July 3, 2020

So we write this to create multiple classes with the same parameters but assignable to multiple objects with independent variables (one has 10hp the other 20), did I understand that right?

Reply

Electrocoders

July 3, 2020

Thanks for the video! It is really informative.

Reply

Connor Payne

July 3, 2020

can i please use those "aww" sounds at the beginning in a game

Reply

Sleepless Games

July 3, 2020

Came back to this video because it's a good way to handle multiple weapons

Reply

Rubiksmaster02

July 3, 2020

5:30 doesn't override ToString

Reply

Leave a Reply