Firstborn/Assets/RPG Creation Kit/Scripts/Equipment System/AttachToMesh.cs
Schaken-Mods 959e80cf72 assets upload
assets upload description.
2023-03-28 12:16:30 -05:00

23 lines
570 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using RPGCreationKit;
namespace RPGCreationKit
{
public class AttachToMesh : MonoBehaviour
{
[SerializeField] SkinnedMeshRenderer attachTo;
[ContextMenu("Attach To Mesh")]
void Attach()
{
SkinnedMeshRenderer newMesh = GetComponent<SkinnedMeshRenderer>();
newMesh.transform.parent = attachTo.transform.parent;
newMesh.rootBone = attachTo.rootBone;
newMesh.bones = attachTo.bones;
}
}
}