![見出し画像](https://assets.st-note.com/production/uploads/images/142016588/rectangle_large_type_2_2ce18bdc093f8a477d9d6bbb307d325f.png?width=800)
【アバター改変】Physboneの設定をアニメーションする
Physboneの設定値を変える
前回これをやった
フィズボーンで他人が指をつかめる(Grab)をアニメーションで切り替えられるようにしたい
Physboneのプロパティは裏技的にアニメーションできる
この裏技はPhysboneドキュメントに書いてある
PhysBone properties like Spring, Pull, Stiffness, etc are set at initialization and cannot be animated.
However, if you animate a property of a PhysBone component and then animate the component off and then on, you may get the behavior you want. Be aware that this is not a supported method of animating these properties, and will not be supported in future changes. (In other words, it might break. If it does, we're not going to try to fix it.)
意訳
・フィズボーンのプロパティはアニメーションで変更できない(cannot be animated)
・でもコンポーネントをオフしてからオンにすると望む結果が得られるよ(←?)
・ただし、サポートされてないやり方なので将来への保証はないから注意してね
とりあえず今もできるか確かめる
アニメーションファイルを実装する方法
・Physboneの設定値をアニメーションするだけ→効果なし
・Physboneのオンとオフを切り替えてからPhysboneの設定値を変えてふたたびオンにする→ちゃんと動く
![](https://assets.st-note.com/img/1716819920226-Tvji5DQdbM.png)
このテンプレートを使用する
アニメーションファイルはこうなる
![](https://assets.st-note.com/img/1716820281530-aEiCfFafe7.png?width=800)
![](https://assets.st-note.com/img/1716820299200-JlqhfVWNFs.png?width=800)
![](https://assets.st-note.com/img/1716820307938-Z3hqt8M6ci.png?width=800)
![](https://assets.st-note.com/img/1716820325382-6aQtXSBrNK.png?width=800)
(あとはHand_Rも追加してね)
このアニメーションを順再生すると掴めるようになる
このアニメーションを逆再生すると掴めないようになる
つまり遷移図に同じアニメーションファイルをセットしてspeedを-1にするだけ(!)
![](https://assets.st-note.com/img/1716828614207-jGjJKseuq0.png?width=800)
![](https://assets.st-note.com/img/1716828624008-jdbzSi5lG5.png?width=800)
![](https://assets.st-note.com/img/1716828807059-iNWFzVxh3x.png)
おわりに
physboneの設定値をエクスプレッションメニューなどから変えることができる。髪の揺れ方を変えたり、胸を揺らしたり揺らさなかったりを切り替えたりもできる
この記事が気に入ったらサポートをしてみませんか?