update animations on equipped items

I’m very close to being able to equip items to my players, super excited about that, but I seem to be missing one last step to getting it all to work properly. Right now I can properly instantiate a piece or equipment (in this case some armor) and it is attached to my player and even animating. Awesome! The only problem I am having is that while the armor is following the idle animation, when my player starts walking the armor does not update to follow the same animation. How do I update what animation the armor should be using?

Can you add more detail please.
When the armor is instantiated - which bone is it being attached/parented to?
Does the armor pieces have there own animations, or are they supposed to be inheriting the position/rotation of the parent bone?
Is there a method or can you add a method for you to check in your code if the armor is still parented to the bone when the animation changes, debug.log?

Yes, details would certainly help. Let me do my best to explain what I have. The Player is of course instantiated when the game runs, but the Armor is instantiated later when the Player picks up the item and equips it. There will be many items so I know I don’t want to have the models attached to the player model and toggle then on/off.

The Armor is instantiated as a child of the armature on the Player

The Armor itself was made by taking the Player file and creating the Armor directly from that. So the weight painting and armature is already set up. The armor is its own file, which right now just contains the model and the same armature from the player. So all animations should be based off what the Player does. That being said, I would like to figure out how to change the armature to the Player armature.

I suppose I could add in a methode like that, but I have just started animations so I’m exactly sure how I would check something like that

Update: so I’ve been doing some digging and I am utterly shocked at how little info there is on this. There are 0 tutorials from Unity and on YouTube I found a total of 3 videos. That’s it. There’s literally no info on doing this, yet I see a lot of people asking about it. This system is possible to impliment right?

I did work on trying a few tutorials and they are either too confusing to actually use or they have other systems that are different enough that mine won’t mesh with what they have. I have managed a few tries but nothing seems to work. I get the item model imstantiated and even animating, but it won’t take the animation of the player it is attached to. It will only play its own animation rather than adjust to the player, no matter what I try

I did find a littlw bit of info about SkinnedMeshRenderers, which seems like it could work. But so far I haven’t been able to figure those out either.

Any help at all would be amazing!

1 Like

It is considered privileged information - :slight_smile:
Seriously though - I think this is due to the unique requirements of each individual setup/system, all are subtly/slightly or sometimes drastically different - so - tutorials covering this advanced topic would probably only be semi-helpful, relevant if the setup was going to be exactly the same as the provided example. Overall ‘customizable character’ system has a lot of different ‘moving parts’ to deal with and each moving part can introduce many differences into the system.
Unity used to have one example tutorial - but this was back even before 4.0 and was only setup with the legacy animation system.

I think this thread provides the information you are after
https://discussions.unity.com/t/386510
but if not here are other information bits that may help.
https://answers.unity.com/questions/234395/rpg-armors-and-clothes-best-way-to-animate-each-pa.html

https://discussions.unity.com/t/618126/16

https://discussions.unity.com/t/591197/2

https://discussions.unity.com/t/537288/5

http://wiki.unity3d.com/index.php?title=SkinnedMeshTools

I have a bad attitude about this subject.

I have had exactly the same experience as you. This game engine seems to be missing the most mind numbingly common requirement for allowing equips. I absolutely disagree that this is not covered because every game has its own requirements. No, making an item follow a certain skeleton’s animations is basic enough that not including it is outright sabotage. As an animator, not a programmer, I’ve lost weeks trying to figure out whats going on and I have finally come to this conclusion:

#1 Unity has zero existing systems for this.
#2 Most people will tell you to use a mesh-welding plugin from the asset store
#3 The same issue will happen when you try to use LODs with bits from different fbx files.
#4 Unity has zero documentation on this. (Even the LOD docs dont mention skinned meshes)
#5 No configuration of parenting or ordering components will solve this. Stop trying to find the secret built-in way.
#6 The solution is to write code that, get this, goes through the bones in your equip and matches their matrix to the current animation by bone-name string searches and comparisons. Yes, it sounds slow and very likely is. It sounds primitive and is. It sounds like something that should be handled by any game engine but with Unity it most definitely is not.

Frustration levels will be off the chart for every artist that starts in Unity having faith that common and obvious systems exist for stuff like this. Some will rage quit (almost me). Some will just stop making things with variety (me). Some will find or write scripts to match bones after wasting a lot of time. Unity will continue making photogrammy and machine learning and story-board tools and ignore the stuff like animation matching/skeleton sharing for equippables.

1 Like