kblack0610
New member
Hello, I have my behavior tree and tasks referenced in a controller script that I'm using to tie to persistent data I have saved (it loads during runtime when the enemy is instantiated, i.e distance to target, etc). When I access the behavior tree references I have in my behavior tree and try to change the variable, the variable values don't change for the task on the tree of the object.
What's weird is after I've made the change I log it and it shows the changed value, but looking at it from the behavior tree inspector nothing has changed. I've tried with both a shared variable and variable.
Does the variable need to be exposed in some way in order for the value to be changed? Or is it not possible to change these values at runtime within a behaviour tree. Was going to attach the logs of the value being changed and the unchanged behavior trees, but the image files are "too large". Any help would be appreciated! (not sure if this is why external pools or used, or if I need to expose the variable differently, or something else)
Here's how I'm changing the value:
What's weird is after I've made the change I log it and it shows the changed value, but looking at it from the behavior tree inspector nothing has changed. I've tried with both a shared variable and variable.
Does the variable need to be exposed in some way in order for the value to be changed? Or is it not possible to change these values at runtime within a behaviour tree. Was going to attach the logs of the value being changed and the unchanged behavior trees, but the image files are "too large". Any help would be appreciated! (not sure if this is why external pools or used, or if I need to expose the variable differently, or something else)
Here's how I'm changing the value:
Code:
seekIsDistanceReachableTask.Distance = AIStats.minWalkToDistance; //variable
seekIsDistanceReachableTask.testDistance= AIStats.minWalkToDistance; //shared variable
Last edited: