自作したCalculatorでDistanceTransitionが正常に動きません

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を確認の上、それでも使い方がわからない場合にご質問ください。欲しい機能の記載がドキュメントにない場合は機能が元から存在しない可能性が高いので要望フォーラムへ。
rrr
Posts: 7
Joined: 2019/02/20 06:36

自作したCalculatorでDistanceTransitionが正常に動きません

Post by rrr »

エディター時のシーン上には存在せず、シーンを実行した後に動的に生成されるオブジェクトのTransformを捕捉したいので以下のようなCalculatorを作りました。

Code: Select all

public class FindGameObject : Calculator {
	/// <summary>
	/// Component
	/// </summary>
	[SerializeField] private string target;

	/// <summary>
	/// GameObject
	/// </summary>
	[SerializeField] private OutputSlotTransform _Transform = new OutputSlotTransform();
	[SerializeField] private OutputSlotGameObject _GameObject = new OutputSlotGameObject();

	// Use this for calculate
	public override void OnCalculate() {
		_Transform.SetValue(GameObject.Find(target).gameObject.transform);
		_GameObject.SetValue(GameObject.Find(target).gameObject);
	}
}

ステート図はこちらです。
2361313647ea2b187b4aed02d22abcb6.png
2361313647ea2b187b4aed02d22abcb6.png (243.34 KiB) Viewed 3667 times
しかしWaitステートのDistanceTransition部分は正常に動いても、
PrepareステートでのDistanceTransitionが正常に動かずAtackステートに移行してくれません。

Find Game Object 部分を試しに Transform.Get Calculaorに差し替え、シーン上にあるものをアタッチする場合は正常にAtackステートに移行したのでPrepareステートのビヘイビア自体には問題がないようです。

Waitステートでは正常に動くのにPrepareステートでDistanceTransitionが働かないのはどういった原因が考えられるでしょうか。

ちなみに、Find Game Object CalculatorからTransform.Getへ噛ませてもダメでした。
また、Paramatorコンテナーを用意して、そこにFindGameWithTagビヘイビアで動的にGameObjectをキャッシュし、Transform.Getを噛ませる方法でも正常に動きませんでした。

ご助言いただけると幸いです。
User avatar
caitsithware
管理人
Posts: 493
Joined: 2015/08/17 12:41

Re: 自作したCalculatorでDistanceTransitionが正常に動きません

Post by caitsithware »

rrr wrote: 2019/05/13 13:07 Waitステートでは正常に動くのにPrepareステートでDistanceTransitionが働かないのはどういった原因が考えられるでしょうか。
まず、基本的なところとして、FindGameObjectからのデータ接続線の値を表示してみて、nullになっていないかをご確認ください。

もしWaitステートへのデータ値もPrepareステートへのデータ値もともにnullになっているようでしたら、FindGameObjectでの取得に失敗しております。
(Waitからの遷移は正常に動いている、ということなのでこの可能性は低いですが、念のため)
Waitステートへのデータ値は正常、Prepareステートへのデータ値だけnullでしたら、Arbor本体の不具合ですので詳しく検証の後修正いたします。

[追記]また、aaaオブジェクトが途中で消えた場合もnullになり、遷移条件に合致しなくなりますので、その点もご確認ください。

ともにnullではないのでしたら、自身のオブジェクトとaaaオブジェクトとの距離がPrepareステートのDistanceTransitionの条件に合致する範囲内(2m)かを確認してみてください。
2m以内に近づかないと4秒経過後にWaitステートに戻り、その瞬間既に12m以内であれば一瞬でPrepareステートに戻る、という遷移になっているかと思います。
シーン上のオブジェクトで検証した時は偶然条件に合致していた、という場合も考えられますので、念のためご確認よろしくお願いいたします。
Post Reply