So I have a system where I can change a party member's class and using conditional prefabs I can change the combatant's prefab to fit the current class.
I would however like to control the animations based on the weapon the character is using. I think it'd be nice to have several Animator Controllers with the same setup, but different animations attached for different weapons. I'm just not sure how I should go about changing the animator controller based on the weapon type. Any tips?
Let me know if you need more detailed instructions :)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I really only need to change the animator in battle. I can change the animator with script. How do I check the item type of the equipped weapon though?
I figured I'd simply put a script on the combatant's prefabs that immediately sets the animator in Start() if they have that specific weapon type attached.
Could this be done with makinom too?
And I found the way to actually access the equipment type based on ID. If anyone else is struggling with this:
combatant.Equipment.IsTypeEquipped(EquipSet.Weapon,2,0)
The 2 is the ID in ORK for the Item type, the 0 is the equipment partID. I have weapons in the first slot in ORK.
If you want to use code easiest way to do equipment specific stuff is to attach any monobehavior to prefab that gets spawned in players hand and do modifications based on the Start Function of that. You could set Int variable in Mechanim based on your weapon and all that.
You can also check if an item type is equipped on any equipment part by using -1 as the part ID/index.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!