How do I get a float comparison to recognize an AI component value?

markrrrrrr

New member
I'm trying to create a tree similar to the one in your BT/UCC example scene, but for now without UCC. (I want to do a lot of experimentation with behavior trees, so I'm keeping my scenes as simple as possible.) In your example, the highest priority float comparison -- for ammo -- is using DemoAgent.Ammo; I want to do the same with my AI agent. I added a script that does nothing but set a public float AmmoLevel. Then in the BT Editor I added a float and clicked the triangle button, hoping to connect the variable with the AI agent's AmmoLevel. I can't access it. I can access the agent's Animator, Rigidbody, CapsuleCollider, and NavMeshAgent components, but none of the other components.

I read through the documentation, but I couldn't find anything that really seemed to address this. Sorry if I'm missing something that should be clear.
 
You'll need to ensure you create a property for your field. This property should have a getter and a setter and a SharedVariable for that type should also exist.
 
Top