Interrupt doesn't work as intended?

abc123

Member
Sorry Justin, I didn't send you the scene, as it takes literally 10 seconds to compose. It contains an object with Behavior Tree component, which restarts on complete, and 5 basic tasks. I expect that we should never run into Log Finish, because the Sequence interrupts itself each frame. Instead, it always runs the whole Sequence, as you can see in a log. Either I don't understand how Interruption works, or it doesn't work as intended.

444.PNG
 
Last edited:
Took me a little bit to look into this because I forgot about this property. If you deselect Instant on top of the Perform Interruption task it should work. What is happening is that by the time you are within the Sequence branch the execution is beyond the point that the code checks for interruptions. This is why the branch keeps executing to the Log Finish. By deselecting that Instant field you are telling the behavior tree to go back and rerun the starting logic during the next tick.
 
Took me a little bit to look into this because I forgot about this property. If you deselect Instant on top of the Perform Interruption task it should work. What is happening is that by the time you are within the Sequence branch the execution is beyond the point that the code checks for interruptions. This is why the branch keeps executing to the Log Finish. By deselecting that Instant field you are telling the behavior tree to go back and rerun the starting logic during the next tick.
Yes, but unfortunately it doesn't help at all. By design my tree must compute all the data at current frame. So, I guess, Perform Interruption task description is wrong? It says "immediately", but in reality its "next frame". May be you could make it instant in upcoming updates?
 
Last edited:
Actually, this works at current frame with instant on, so I'm going to use it for my needs. May be somebody will find it helpful too.

111.PNG

222.PNG
 
Glad you got a solution! I am currently working on version 2 and while I'll take another look at this when adding the interrupt task.
 
Top