Problem with the AI Blueprint Decorator (Bug???)

Hi Everyone,

I was having a problem with my own custom blueprint decorator that I use as guard to execute a behaviour subtree. The subtree was always executed whatever the return condition was set … I though that the problem was coming from my code so I tried the Blackboard decorator to test a variable value. Here again the subtree of the selector is always executed even if the condition of the blackboard is not met…strange … strange … is this a bug ? or am I doing something wrong…

I attach some of my code and debug infos. As you can see, the state bb variable is set to “wander” so it is not equal to “flee”. But the ping task is always called (The ping task simply prints a message on the screen and returns a success value of true)

Can anyone help with this please :slight_smile:

I think this is most probably a bug, have you posted this in the Bug Reports section of the answerhub? There you will mostly get an answer from epic within one day…

Thank you for the reply i ll post a message in answerhub.

I confirm also that this is a bug because when I put the decorator on the Task node directly and not on the composite node then the decorator is called correctly and acts as a guard on the task as expected.

Since decorators are working fine with tasks I suggest this workaround: translate all decorators placed on a composite tasks to a sequence of a boolean task that returns always TRUE and a subtree representing the composite node.

I think that the following expressions are logically equivalent (but less efficient):

[Guards]Composite(…) <=> Sequence( [Guards](Task: return TRUE) ; ]Composite(…) )

Kind regards,