Skip to content

Instantly share code, notes, and snippets.

@afterburn
Last active April 14, 2023 21:32
Show Gist options
  • Save afterburn/6cad959ff8ea27b12455755e9748bac0 to your computer and use it in GitHub Desktop.
Save afterburn/6cad959ff8ea27b12455755e9748bac0 to your computer and use it in GitHub Desktop.
Synchronizes the bones of one SkinnedMeshRenderer with another
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[ExecuteAlways]
public class BoneSynchronizer : MonoBehaviour
{
public SkinnedMeshRenderer proxy;
void Start()
{
foreach (SkinnedMeshRenderer smr in GetComponentsInChildren<SkinnedMeshRenderer>())
{
if (smr != proxy) {
smr.bones = proxy.bones;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment