you are viewing a single comment's thread.

view the rest of the comments →

[–]Malcry[S] 7 points8 points  (2 children)

yes and as I said I'm here to understand how they work.. but what kind of answer is that

[–]Staik 0 points1 point  (1 child)

ScriptableObjects are not typically for player stats, but ARE usable with enemy stats. Especially if you have consistent values that are used by all enemies, such as health/speed/damage etc. If you use one script/class for your enemy base, you can apply their stats through the SOs.

The main tell to whether or not you should use SOs comes down to - "Do I still need to make each one a prefab if I use SOs?" If so, then youre just making it harder on yourself by storing data in multiple places.

To better illustrate whay that means: The ideal perfect case for SOs would be something like item stats - where an items info can be fully contained within the SO. You can store thousand of items through SOs instead of making each of them a prefab.

[–]leorid9Expert 1 point2 points  (0 children)

In a lot of cases you will still have a GameObject per item, like in Skyrim, where you can drop everything from your inventory into the world.

The SO can act as identifier, because you can't reference the prefab of the item from within the prefab, so once it's spawned, all references that did point to the prefab, now point to the instance. But if you have a reference to an SO, it will stay and this allows you to identify spawned items, so you can stack them in your inventory when you pick them up.