unity : mecanim 手首の位置に武器を持たせる。
前回作ったものに武器を持たせました。
右手首 ORG-hand_R の位置を取得して武器オブジェクトの位置をあわせています。
Startで
public Transform Ken;
private Transform hand;
void Start(){
hand = SearchBone( transform, "ORG-hand_R");
}
みたいな感じで、SearchBoneは、transform.getChildで探しているだけです。
あとは、Updateで hand.position, hand.rotationを利用して Ken に設定しています。
これで武器変更も自由に出来ます。