- Home /
Shared skeleton issue
Hello, I have a problem, I try to add clothing to my game but I encounter issues with sharing skeleton between a character model and the clothing model. It works in case of the pants (it suddenly started working after many attempts) but I cannot repeat it, even after using the same procedures. My script used to share skeleton looks as follows:
public class ClothingRigging : MonoBehaviour
{
[SerializeField]
SkinnedMeshRenderer targetSkin;
[SerializeField]
SkinnedMeshRenderer inputSkin;
private void Awake()
{
inputSkin.bones = targetSkin.bones;
}
private void Update()
{
if (Input.GetKeyDown(KeyCode.Space))
inputSkin.bones = targetSkin.bones;
}
}
I know there is optimalization to be done but I was just trying to find where a problem can be - the script is used for the pants and it works though. The clothing (which is a breastplate) has completely the same rig as the character model.
Here are the screenshots from Unity, first one is in the edit mode, second one is in the play mode. You can see the position and visibility of the breastplate and the inspector settings. I am looking forward to any advice.