Cooldown Decorator 4.20 Can still be used

So Playing with Cooldown decorator a little a little and I found that though it works differently then in the video it can still be used, you just have to account for the rest of your tree.

Basically the Cooldown sets the AI Path to blocked for the 5 sec, so execution continues along the rest of the path until the cool down is up, thus allowing the Shoot to fire again. To use cool down then you should create another branch to give your AI something to do while waiting to fire at the person again, perhaps a “Move Random” Branch as i do in this pic

I’ve tested this out, and he does move around at random and shoot, though his legs glitch around a little.

Thinking about this a bit more, and actually finishing the lession, i belive that all that is really needed is to add a Loop to the “Can See Enemy” Selector. This will keep this branch active until the Can See Enemy Condition fails/

This thread is very old and this part of the course is probably obsolete, but for the people that still want to do the archived course:

While Joe makes a good point, you don’t want to add behavior to a tree or evaluate a loop if it’s not strictly necessary. Is a lot simpler and more elegant if you just make the branches mutually exclusive, as you can’t count anymore on the cooldown node to make it so. Inverse decorators will do so and are more descriptive of what’s happening if you change the decorator’s node names, and also you allow the tree to do nothing beyond rechecking the decorators if all decorators are false, that I’m sure UE4 uses optimizations for.

@Nacapa_Alberto I tried your approach and it doesn’t seem to work - maybe having the additional branch as @Joe_Harvey suggests is actually right as my AI doesn’t have anything to do. So it just goes back immediately to shooting irrespective of the inverse decorator conditions.

Privacy & Terms