1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Groomを風で揺らすには

Posted at

GroomTest - Unreal Editor 2025-05-29 09-48-16~2.gif

0.環境

UE5.5
Windows11

※Alembic形式でインポートしたGroomを使用しており、他形式のGroomはうまく動かない可能性があります

大体これに乗ってる内容です

1.Physicsを制御しているNiagaraをコピーする

Groomの重力などの揺れはNiagaraで制御されています
スクリーンショット 2025-05-29 102629.png

Niagara SolverをCustom Solverに変更します
image.png
デフォルトのStableSpringsSystemをブラウズすると
/All/EngineData/Plugins/HairStrands/Emitters
に移動します

image.png
GroomSpringSystemとSetupGroomPhysicsを自分のフォルダのわかりやすいところにコピーしておきます。わかりやすいように名前も変えておいてください。

image.png
コピーしたGroomSpringSystemにSolverを入れ替えておきます。
ついでにEnable Simulation(物理をシミュレーションするかどうか) にもチェックを入れておきます。

2.Niagara Moduleに風の項目を追加する

コピーしたSetupGroomPhysicsを開きます。
InputMapにつながるMapGetにVectorを追加していい感じに命名します
image.png

追加したらSet the forces propertiesのMap SetのAir Velocityにつなげます
image.png
これで風の力の入力ができるようになりました

3.Niagaraのモジュールを入れ替える

先ほどコピーしたGroomSpringSystemのほうを開きます。

もとからあったSetupGroomPhysicsを無効にして、先ほど編集したSetupGroomPhysics(コピー版)を追加します。
image.png
詳細に先ほど追加した風用のVectorが表示されているはずです。
image.png

ここに数字をいれるだけで、すでにGroom側で毛がはためいている様子を確認できます。カーブなどで自動ではためくようにしてもいいですね。
このVectorは、Groomが回転しようがGroomComponentが回転しようが、常に一定方向から吹きます。回転しても重量が反転しないように風の方向は変わりません。べんりやなあ

今回はBPで制御したかったのでユーザー変数を追加しておきます。
image.png
image.png

4.BPで風を制御する

Groom用のNiagaraのユーザー変数はレベル上に置かれたGroomから直接触ることはできませんが、BPに配置されたGroomComponentから取得することでアクセスができます

image.png

GroomTest - Unreal Editor 2025-05-29 09-48-16~2.gif

でけた

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?