• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
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 :

alt text alt text

     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
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ericbegue · Aug 06, 2016 at 09:27 AM 0
Share

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.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

136 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Game Object 2 different movement pivots 0 Answers

how do i keep an item destroyed when i change the scene c# 0 Answers

Script problem: Trying to make the code of this script run at a set interval (GUI handle object) 1 Answer

C# Unity dot syntax exercise correct solution? 1 Answer

RAIN AI - Enemy shoot player 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges