プロパティのAgent Controllerについて

Here is the forum to do the questions about how to use to Arbor developer.
Attention point:
  • We can not answer your questions about your project specific issues.
  • We can not answer your questions on Unity's specification issues.
  • Please check Arbor Documentation and ask a question if you still don't know how to use it. If the desired function is not described in the document, it is highly possible that the function does not exist from the beginning, so go to the request forum.

ここは、Arbor開発者へ使い方に関する質問を行うフォーラムです。
注意点:
  • ユーザー様のプロジェクトの仕様上の問題や設計に対する質問には答えられません。
  • Unityの仕様上の問題に対する質問には答えられません。
  • Arbor Documentationを確認の上、それでも使い方がわからない場合にご質問ください。欲しい機能の記載がドキュメントにない場合は機能が元から存在しない可能性が高いので要望フォーラムへ。

Forum rules
Here is the forum to do the questions about how to use to Arbor developer.
Attention point:
  • We can not answer your questions about your project specific issues.
  • We can not answer your questions on Unity's specification issues.
  • Please check Arbor Documentation and ask a question if you still don't know how to use it. If the desired function is not described in the document, it is highly possible that the function does not exist from the beginning, so go to the request forum.

ここは、Arbor開発者へ使い方に関する質問を行うフォーラムです。
注意点:
  • ユーザー様のプロジェクトの仕様上の問題や設計に対する質問には答えられません。
  • Unityの仕様上の問題に対する質問には答えられません。
  • Arbor Documentationを確認の上、それでも使い方がわからない場合にご質問ください。欲しい機能の記載がドキュメントにない場合は機能が元から存在しない可能性が高いので要望フォーラムへ。
AGame2

Re: プロパティのAgent Controllerについて

Post by AGame2 »

申し訳ございません。
途中で送信してしまいました。
各処理にあるプロパティのAgent Controllerについて質問です。

AgentMoveToTransformのAgent ControllerをSelfやRoot Graphとした場合は想定通りに動くのですが、
Parent Graphにした場合に想定通りの動作となりません。

やろうとしていることは下記の通りです。
キャラクターAにBehaviarTreeを持たせ、SubBehaviourTreeReferenceのExternalBTに
再利用可能なBehaviarTreeを持ったBオブジェクトを指定して実行しています。
Use Directly In Sceneをfalseとしているので、キャラクターAの下にBオブジェクトのコピーが作成されました。
BオブジェクトのBehaviarTreeでは、AgentMoveToTransformを使って指定場所に移動する処理を設定しています。
Selfの場合は、BオブジェクトのはAgent Controllerを持っていいないので動かないので想定通りです。
Root Graphとした場合、ルートとなるキャラクターAはAgent Controllerをもっているので動くのでこれも想定通りです。
(最初は、GameObjectのルート関係を見るものと勘違いしていました。)
しかし、Parent Graphとした場合に動きません。キャラクターAとBオブジェクトは親子関係となっているので動く想定でいたのですが、
考えられる原因がありましたらご教示願います。

補足として、BオブジェクトのBehaviarTree内は、Root→SubBehaviarTree→SubStateMachineの階層構造となっており、
実際の処理ではStateMachineでAgentMoveToTransformを呼び出す流れとなっております。

また、当初オブジェクトBはプロジェクト上のプレハブを使用する想定でしたが、
この問題を調査するためにヒエラルキー上のものをコピーさせていますが、どちらの動作にも違いはないでしょうか。
User avatar
caitsithware
管理人
Posts: 493
Joined: 2015/08/17 12:41

Re: プロパティのAgent Controllerについて

Post by caitsithware »

ご利用ありがとうございます。

FlexibleGameObjectやFlexibleComponentの参照方法をHierachyにした場合はすべてグラフの親子関係での参照になっております。
  • Self : 自分自身のグラフ
  • Root Graph : 自分自身のグラフから親グラフを辿ったルートのグラフ
  • Parent Graph : 自分自身のグラフの親グラフ。
今回の場合は、BオブジェクトはBehaviourTree(ルート)→SubBehaviourTree→SubStateMachineと3階層になっているとのことなので、SubStateMachineから見た親であるSubBehaviourTreeを参照しようとします。
親となるSubBehaviourTreeも内部的にはオブジェクトBのコンポーネントとして設定されていますので、Selfと同様Agent Controllerがないので動作しないのが正常です。
AGame2 wrote: 2023/01/26 07:30 ヒエラルキー上のものをコピーさせていますが、どちらの動作にも違いはないでしょうか。
シーンに配置しているオブジェクトは実行中に変更される可能性もありますので、Instantiateされるまでに行われた変更もコピーされるという違いがあります。
AGame2

Re: プロパティのAgent Controllerについて

Post by AGame2 »

ありがとうございます。
よくわかりました。

SubBehaviourTree、SubStateMachineで再利用を検討する場合、Parent Graphを選ぶのがよさそうですね。
Post Reply