Question by
Nutricula-Project · Aug 05, 2016 at 12:04 PM ·
unity 5scripting problemaiscripting beginnerrain
How to get variables of a behavior tree with RAIN AI
Hello there ! I search how to use the variable of my behavior tree. I have a form variable called "varVisual", when nothing is detected the variable is null, and when something is detected the variable is'nt null. The sensor is a visual sensor. I want to know in my script when the variable is null or not. I tried a lot of things, like this :
void Awake()
{
_aiRig = GetComponentInChildren<AIRig> ();
visualSensor = _aiRig.AI.Senses.GetSensor ("eye");
}
// Use this for initialization
void Start ()
{
if (visualSensor == null) {
Debug.Log ("visualSensor == null");
} else if (visualSensor != null) {
Debug.Log("visualSensor != null");
}
How could I know the state of the constraint in my behavior Tree (RUNNING or FAILURE) or what varVisual is equals (null or != null) in my script.
Thanks !
capture-decran-44.png
(135.7 kB)
capture-decran-43.png
(129.7 kB)
Comment
Hi! I'm not familiar with RAIN, so sorry that I can't answer your question. But if you are looking for a programmer-friendly Behaviour Tree framework, you might be interested to have a look at Panda BT.