Equipping without instantiating a equipment prefab

Jakuri

New member
Hi Devs,
I found it will instantiate an equipment prefab (e.g. SwordUsableWeapon(Clone)) after equipping, which in unnecessary for me.
I just want the equipment's attributes affect the character. What should I do?
Thank you!
 
Another question, when I save and load game, the equipped equipment's attribute cannot affect the character, although it is in the right slot and inventory. Maybe the reason is the "Item Object" is missing.

How can I avoid this? Thank you!

截屏2023-12-01 15.39.11.png


截屏2023-12-01 15.38.46.png
 
You'll want to use the base class of the Equipper script. It's called EquipperBase. That component stores the equipped items and without spawning objects. it's meant to be inherited by a custom class so you can build on top of it.

As for your second question, I'm unsure. My guess is probably the way you compute stats for your character. You may need to tell it to "refresh" the stats after the loading has finished. But my guess is that it has nothing to do with not having ItemObjects
 
Top