I’m trying to use a blackboard object key as part of my behaviour tree setup, but I am genuinely struggling to get it working - it seems that the value is either not being set, or cannot be recalled.
The blackboard contains a key that is of type object, with base class being set to MyClass. Within the task (BTTask_Blueprint), I have an array of MyClass instances from which I wish to pick a new one at random which isn’t the previous one. In order to facilitate this, each time this task is about to execute, I set the blackboard value for this MyClass key using Set Blackboard Value as Object, and I recall it when the task begins anew using Get Blackboard Value as Object.
Get Blackboard Value as Object is always giving me null, and I don’t know why this is the case. The other non-object blackboard keys are working as expected.
Have I missed something, and is there a way to actually debug this? I’ve gone as far as printing strings will take me.
As a side note, why is there a ‘Get Blackboard Object as Actor’ but not a corresponding ‘Set Blackboard Object as Actor’?
Get Blackboard Object as Actor is a helper function to get an Actor on the output and save yourself some casting, that’s all.
Regarding your issue, I’ll need more information. Which UE4 version are you using? Could you post some images of your BP setup? Or even better, could you share the blueprint of your task?
I’m using 4.6 at present. The task is a little large, so here’s a very simplified version setup. In this example, each time the event is fired, it will consistently travel down the Not Valid path, indicating the value of CurrentPOI is null - either from failing to be set, or failing to be recalled.
Edit: I should clarify that ‘MyActor’ is of the correct type as indicated in the Blackboard!
Can you double-check if your My Actor contains any data? You can put a breakpoint at Set Blackboard Value as Object (just click it and press F9) and once it gets hit mouse over the My Actor to see the value. LMK.
How, or when do you populate your actors list and set My Actor?
In the case of my actual task, I know that the actor has data - I’m outputting it’s display name to the screen immediately prior to setting the blackboard value.
Edit: The actor list is currently populated via an all actors iterator, and is working correctly.
Update: I have used actor display names and a string key instead of the object key, but the string key is also not being set. I can see the blackboard whilst the game is running, and whilst the vector key in the blackboard is working, the string key is not, despite me being able to print the same string to the screen immediately before setting the blackboard value:
Sorry about necro-ing this post but I have a similar issue and it is driving me crazy (my original post : link text ) . The issue really is the same, I am setting up a blackboard actor but once I try to get it, it returns None event though the value IS set. I made several tests to make sure of it.
Your problem is two years old but, by any chance, do you remember/know what was causing trouble ?