How are attributes applied?

DrewofDonuts

New member
Right now the weapons in my game receive their stats from a scriptable object (SwordConfig), and then the monobehavior script(Weapon) on the weapon game object receives those stats, and applies damage + player base damage to the enemy.

My question is, I know UI will replace the scriptable object for attributes, but how does it apply damage (for example) as well combine with player stats? Would my process change much?
 
The UIS item will replace the SwordConfig scriptable object.
But your Weapon script could have the same logic as right now.

The way I would do it is add an "Item Object" component next to your Weapon component. And then you may have the Weapon component listen to the Item Object component for any changes on the Item. You could use that event to spawn the correct Mesh/Model for your item, change the stats on the weapon, etc...

You can read more about Item Objects and using items in the scene world here:

Make sure to check the subsections too, you might find some useful tips.

Another component which you mind find useful is "Item Binding" which lets you bind attribute values of an item to component properties.
In the UIS demo you may find a prefab called "WandUsableWeapon" This is the prefab we use in the demo which fires projectiles using the item attributes to know the projectile prefab, quantity of proejctiles ect.. It should give you some ideas.

Note that you do not have to follow those tips to the letter, these are just suggestions you are free to use your UIS Item however you want
 
Top