Indeed the Script Control tasks do not work with variable objects that are set at runtime due to not knowing what components will actualy be on that gameobject. I am looking at ways to improve that though.
You can use the following simple Condition Task to check if a game object is active or not:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
using UnityEngine;
namespaceNodeCanvas.Conditions{
[AgentType(typeof(Transform))]
[Category("GameObject")]
publicclassIsActive:ConditionTask{
protectedoverride boolOnCheck(){
returnagent.gameObject.active;
}
}
}
As in every task, if you want to check the condition for a blackboard variable, override the agent and select your variable from the dropdown.