xxbokusu / u1w202309

for unity1week on 2023/9/18 - 9/24
MIT License
0 stars 0 forks source link

[~9/20] 3Dモデル(好きなキャラ)を動かす/mocopiで取り込んだモーションを活用する #2

Open xxbokusu opened 11 months ago

xxbokusu commented 11 months ago

unity chan(3D)を動かして問題ないのを確認した上で、 Boothで3Dモデルを購入したい。

アニメーションはmocopiで収録してBlenderで変換してimportする目算。 編集はBlenderで出来るんだろうか。 形式変換できてればUnityでも弄れはするだろうけど。

ref

https://av.watch.impress.co.jp/docs/topic/1470685.html https://www.sony.net/Products/mocopi-dev/jp/documents/ReceiverPlugin/Unity/UseSampleApp.html https://tatsuya1970.com/?p=17310

xxbokusu commented 11 months ago

blender経由で変換したmotion dataをunityで動かすところまではmocopi sampleでやっていたがmotionの編集は未知

xxbokusu commented 11 months ago

unity chanを取り込んで動かしていく

https://youmanavisions.com/programming/post-18607/ 実にピンクだ image

https://youmanavisions.com/programming/post-19774/

つまりシェーダーもいると。

https://unity-chan.com/download/releaseNote.php?id=UnityChan

たしかに公式でも言及有るのでまぁ入れますか、と。

xxbokusu commented 11 months ago

なんかアニメーション動かんけど。。。 image

https://game.daraha.me/advanced/model3d/ これだ~~~

そうしたらダウンロードしたfbxファイルをクリックし、RigからAnimation TypeをHumanoidに変更。(人型のみ)

xxbokusu commented 11 months ago

生成したキャラがWebGL uploadした場合のみどこかにすっ飛んでいくのを止めたい。 恐らく、BoxColiderの干渉だと思うのだが・・・

Coliderを弄るとこけてしまった。。。 https://qiita.com/_meki/items/5c1df1804d009ec1393e なるなる RigidbodyのConstraint

xxbokusu commented 11 months ago

一度組んだanimationで余計なTransitionを消したい 🤔 https://qiita.com/daisukeokaoss/items/ba5bd09448131f804caf

xxbokusu commented 11 months ago

chara移動ってDotWeenでいいのか…? 変動するのが速度だけだから一応何とかなりそう。

Animatorの状態に合わせてTimeScaleを変更するソリューションになりそう https://shibuya24.info/entry/unity-dotween-reverse

一旦一通りのパスで実装してから分岐を考えるかな。

xxbokusu commented 11 months ago

移動の付与をbool基準にすると、Animatorより早く滑り出してしまう

https://zenn.dev/daichi_gamedev/articles/b74e4f5a17bdc5 ↑animatorのstateを見てみる

残念ながら直接取得する方法は無いですが名前が一致しているかどうかをif (animator.GetCurrentAnimatorStateInfo(0).IsName("Idle"))でtrue,falseで返す事ができるので以下のスクリプトのように疑似取得できます。

xxbokusu commented 11 months ago

地味にinstantiateの親がInitialize sceneになってる。 結果、複数のcharaとstageが生成される事態に。 image

https://kurihara-n.hatenablog.com/entry/2016/08/13/011728

var parent = this.transform; Instantiate(childPrefab, Vector3.zero, Quaternion.identity, parent);

instantiateで親指定ができるので、破棄するシーンに紐づけて回避

xxbokusu commented 11 months ago

ゲーム自体はunity-chanに元々同梱されていたモーションで完成を見て、 改めてmocopiから取り込んでくる。 image うむ image ヨシ! image

coliderが立ち状態に紐づいてるから浮いてしまう

xxbokusu commented 11 months ago

試しにcoliderのチェックを外すと image オアアアシスゥーーーとなる

xxbokusu commented 11 months ago

ref : https://light11.hatenadiary.com/entry/2019/04/18/003100