UNITY ScriptableObject Basics

ScriptableObjects are handy data containers in Unity that you can use to reduce memory duplication and store information. In this video, I use them as an example where you can configure different types of ammo with ScriptableObjects. When you change data in a ScriptableObject, even during runtime, it has immediate and permanent effect in the game.
★ ABOUT ME ★
I'm Imphenzia, and I do KZread videos mostly about game development, 3D modeling, and game assets. I am Swedish, but I currently live in Brisbane / Australia, where I run an independent game development company, Imphenzia Pty Ltd.
★ LINKS ★
My website:
www.imphenzia.com
Support me on Patreon:
/ imphenzia
LEARN LOW POLY Character Modeling - Blender 3.5 Full Course:
• LEARN LOW POLY Charact...
My Universal Sound FX asset with 7000+: game sounds:
www.imphenzia.com/universal-s...
Imphenzia Discord server invite:
/ discord
Imphenzia on X:
x.com/imphenzia
Imphenzia Instagram:
/ imphenzia
Imphenzia itch.Io page with all my Ludum Dare games:
imphenzia.itch.io/
Imphenzia Merch:
teespring.com/stores/imphenzia
In-depth learn how Low Poly Modeling in Blender:
• Learn Low Poly Modelin...
Thanks for watching!!

Пікірлер: 28

  • @JoeTheis
    @JoeTheis6 ай бұрын

    I ended up using SOs in a very similar way before coming to this video. Nice to see I wasn't totally off base! A word of caution on the use of a c# property there: make sure that whatever calculation it is doing is really light weight OR precalculate and cache the value when the projectile is created. I ran into a problem in my game where stats like damage and velocity can be quite complex to calculate (think player bonuses, skills, buffs and debuffs, etc). If you do that every frame for every projectile, and you have hundreds of projectiles in flight (like is an RTS) it can actually show up in the profiler as a major bottleneck! In most cases, projectiles are short lived enough where recalculating that stuff every frame isn't gameplay relevant, but can definitely impact your framerate. Not sure I'd bother if I expected a low number of projectiles, or if the calculations were simple (neither was true in my case)

  • @IdealIdleIncremental
    @IdealIdleIncremental6 ай бұрын

    I've been working with Unity for over three years, yet I've never utilized ScriptableObjects. After watching your video, I'm definitely inclined to give them a try.

  • @StigDesign

    @StigDesign

    6 ай бұрын

    i Highly recomend try to use it in your projects and try to get used to them, it made my menu selection of tracks and cars in 3d racing game so much more easy to manage, but it took time to get used to hov to make scriptable object and communicating with it hehe :D

  • @monkeyrobotsinc.9875
    @monkeyrobotsinc.98754 ай бұрын

    8:20 ahhh hahahah i love that you dont edit out any mistakes and just keep going. super funny.

  • @Mad3011
    @Mad30116 ай бұрын

    11:09 You can achieve the same behaviour by setting this.enabled to false. The most useful thing about ScriptableObjects for me is that you can tweak all those settings on the SO while the game runs, and the changes will persist when you exit playmode. Makes balancing weapons really nice and easy.

  • @MartKart8
    @MartKart86 ай бұрын

    I feel like Imphenzia is the only person, I've noticed that can code and model with easy.

  • @atibyte
    @atibyte5 ай бұрын

    Again a great video, thanks! I would like to watch more Unity videos from you.

  • @davidbaity7399
    @davidbaity73992 ай бұрын

    Great gems of knowledge in this one! Thanks for sharing.

  • @StigDesign
    @StigDesign6 ай бұрын

    I love this mix of videos , your game, 10min challenge and unity tip`s and tutorials/info with example :D lol i had to google what kilogram is but its the same as kilo :D yes Scriptable object is so awesome to use after having it properly set-up, i used it for my tracks and cars in the menu of my 3d racing game, and i think i probably use it in my ShipWrekers/OverBoard! inspired arcade boat game, and 3d fps game am working on at the moment :D Your learning videos is so much more different than other unity videos but it makes them so much more better and really easy`er to learn from :D

  • @rutchjohnson
    @rutchjohnson6 ай бұрын

    Love the new Unity vids!

  • @MrOmega-cz9yo
    @MrOmega-cz9yo6 ай бұрын

    I've seen tutorials that use either ray casts or projectiles. This is the first vid I've seen that uses both at the same time. Interesting. Thanks! I would like to see how you handle object pooling for a large number of bullets.

  • @chemp113
    @chemp1136 ай бұрын

    Thanx, good lesson! 1 question: The bullets that fly further, Rnt needs to be destroyed after some positions? They just keep flying and have calculated?

  • @carzz185

    @carzz185

    6 ай бұрын

    in my case, i'm making a vertical scroll shooter, so when the bullet goes further than the camera it is destroyed

  • @ragerungames
    @ragerungames6 ай бұрын

    Great video. I am interested in knowing the procedure you used for grapple swing and the ability in which player goes back to its original position

  • @picturize8047
    @picturize80476 ай бұрын

    You are a hero

  • @chickenegg1742
    @chickenegg17426 ай бұрын

    Thanks

  • @chrisp7414
    @chrisp74146 ай бұрын

    8:20 :D not exactly 420 related but funny nevertheless, nice way to explain ScriptableObjects. My understanding is that they're also used in games where data needs to persist between scenes s.a. an RPG with player characters leveling up and all the good character sheet stuff.

  • @oldborodach
    @oldborodach6 ай бұрын

    Есть ли у вас курсы?

  • @juleswombat5309
    @juleswombat53096 ай бұрын

    OK, where do we get that T shirt?

  • @ilijastjepanovic2975
    @ilijastjepanovic29756 ай бұрын

    I have the same T-Shirt 🥳

  • @carzz185
    @carzz1856 ай бұрын

    so far i use scriptableobjects mostly for options menu... (volume, screen resolution, etc)

  • @darkman237
    @darkman237Ай бұрын

    You could use an event rather than send msg

  • @johnsmith-jw1do
    @johnsmith-jw1do6 ай бұрын

    Dead engine

  • @bjrn8046

    @bjrn8046

    5 ай бұрын

    Good for you bro

  • @giampaolomannucci8281

    @giampaolomannucci8281

    3 ай бұрын

    as opposed to? what do you develop with?

  • @Ad1s

    @Ad1s

    2 ай бұрын

    Ok

  • @nexuzinnovation-com
    @nexuzinnovation-com6 ай бұрын

    7:34 Trail Renderer is very nice, wish to know more of such similar components. Thanks again for another great tutorial video 👍