That get/set code is a property and you are trying to declare it in a method :). You can simply omit the property and do this, directly calling SetDataValue on the blackboard:
1
2
3
4
5
6
7
protectedvirtualvoidOnMessage_GotKilled()
{
blackboard.SetDataValue(“nearestTarget”,null);
Debug.Log("-------------------ok, Drone knows that target is dead ----------------------");
}
Furthermore, you can check if a game object is active with the ‘CheckProperty’ Condition, through which you can check any property on any component on any game object (image attached) 🙂
If you wanted to check if a blackboard gameobject variable is null instead, you can do so with the ‘Check GameObject’ condition. Simply check ValueA against a null ValueB in that condition.
There are more ways to communicate between objects but I don’t want to confuse you right now.
Let me know if you have any questions and the above suffice 🙂
Cheers
Join us on Discord: https://discord.gg/97q2Rjh
Login
Register
By registering on this website you agree to our Privacy Policy.