Items with multiple actions and different animations

Snickaz1912

New member
The scenario:
I want to implement a system that allows the player to enchant the equipped weapon (magic spell, sword, bow or shield) with elemental magic. So if the player uses the item without enchantment, the item will be used 'normally'. This means that the sword strikes normally, the bow shoots normal arrows and the Magic item creates a small blast wave. So far so good. If the player now uses the item with an enchantment, e.g. fire magic, a special effect is triggered when it is used. The sword now burns the hit enemies, the bow shoots burning arrows and the magic item creates a fire wave. If water magic is taken as an enchantment, the sword freezes the hit enemies in ice when used, the bow shoots ice arrows and so on.

The enchantments can also be combined, so if the sword is enchanted with Fire Magic and Water Magic at the same time, Steam Magic is created instead and again creates other effects.

What I have accomplished so far:
I have created a 'SpellWeaver' script which is able to combine the enchantments (fire + water = steam, etc.). To change the effects of the equipped items I add several different item actions to the items (Magic Spell, Melee Weapon, Shootable Weapon or Shield), change the action IDs and trigger the appropriate Use() item ability with the corresponding action ID on the equipped item using the 'SpellWeaver' script (As described here in the online docs and here in the forum).

Would this be the preferred way so far or could the described function be solved even better?

Now to my actual problem:
In the scenario described, it is possible that the item actions of an item cause the character to play different animations. For example, in one case, a magic item may generate a fireball for the corresponding item action, causing a throwing animation to play. In another case, the magic item generates a particle beam for the corresponding item action so that a channeling animation plays. The problem is, that in the "Item Copmonent" i've set an "Animator Item ID" and more, but not every item action needs the same settings from the "Item Comonent". So currently when i cast a fireball or channel a particle beam the same animation is playing (however at least the correct item action with the desired effect is triggered correctly). How could this problem be solved so that i can have the character playing different animations for different item actions of an item?

(Just to clarify, it's the character that i want to play different animations and not the item itself)
 
Last edited:
The best route for this scenario is to have multiple Item Actions for each animation type. This will give you the most flexibility and there is no limit to the number of actions that you can have on a single item. As a basic example all of the shootable weapons in the demo scene can also perform a melee hit.
 
Top