I have a system where I instantiate characters at run time, assembling the components and sub-objects based on several different criteria. This means I can’t possibly manually set up the Locomotion system for every character that I will instantiate. However, each character, despite using different meshes, materials, and other scripts, will all have the same named bones, and will be able to use the same animations. So I’d like to be able to configure the locomotion system just once at design time and apply that somehow to each character as it’s made. We’d also like to avoid having to re-do all the locomotion settings when we add new character meshes to the game.

We will probably start with one of several prefabs that contains a hierarchy of meshes, and then add components at run time to customise it further. Is it somehow possible to copy the pre-configured locomotion components and data from somewhere at this stage? Perhaps from another prefab, or an invisible object? Or is there another good approach we haven’t thought of?

I have a similar premise in my current project, and the way I solved it was to have a common, invisible skeleton prefab with Locomotion System fully set up on it, and I then attached my custom components to that using transform parenting. This is kind of roundabout, but it works solidly for me. Unfortunately, it relies on every body type having the same set of animations, and having the exact same number of bones in the same arrangement in their skeleton. This way, your custom components etc come with the ‘real body’ which is applied on top of the ‘animated body’ which can still be customised somewhat by properly paramaterised movement scripts.

All in all, it’s possible, but difficult. But still better than making new animations for every character! Good luck.