ぼっちプログラマのメモ

Unreal Engineについて書いたりしてます

UE4メモ : ビヘイビアツリーの「Rotate to face BB entry」タスクについて

「指定されたポイントを巡回」というよくあるAIで、
「次のポイントに移動する前に、そのポイントの方向へ回転する」を
ビヘイビアツリーのみで実装したいなぁと思ったわけです。

あ、実行環境は「UE4.10 Preview2」です。


まずは、単純な巡回用ビヘイビアツリー
動かしているのは、Characterアクタを継承したBP。


カクカク…もう少し滑らかに回転して欲しい所です…


と、悩んでいる所で見つけたのが、今回取り上げる
「Rotate to face BB entry」タスク

まずは、何も考えずに使ってみます

…(#^ω^)


「Rotate to face BB entry」タスクについて調べていると、
以下のスレッドにたどり着きました
How can I fix my BehaviorTree to turn smooth? - AI - Epic Developer Community Forums

このスレッドによると、「Rotate to face BB entry」タスクは
実行した瞬間に指定したActorの方に回転する機能を持っているが、
その速度はコントロールできないようです…

The Rotate to Face BB Entry task just requests a character to face given direction and finishes as soon as character does that. This task does not control how fast it's done.

ただ、「Use Controller Rotation Yawを無効」+
「Use Controller Desired Rotationを有効」にすれば、
「RotationRate.Yawの値で回転速度を調整できる」とのことです。

This is the domain of character's properties. If you need non-instant turns you need to make sure your Use Controller Rotation Yaw is disabled and Use Controller Desired Rotation is enabled, then RotationRate.Yaw will control how fast a character can turn/rotate (while moving).

ということで、対象のCharacter継承BPのパラメータを調整

結果


キタ━━━━(゚∀゚)━━━━!!

以上
(各プロパティについて調べたい所だけど、もう眠気MAXなので後回し)
(「到達してから、次のポイントに移動する前に、周りをキョロキョロする」
  的な仕様の場合は、モーション側で何とかした方がいい気がする)