I just came across a huge issue – apparently OnStop of a current node is NOT called before OnExecute of the next node, when this node switch happens because of a DYNAMIC evaluation.
Can someone clarify why this is the case? It breaks the default NodeCanvas nodes, because Patrol / Seek nodes have ResetPath in OnStop:
which actually Stops the NEW path that is generated in OnUpdate of the interrupting/next node:
1
2
3
4
5
6
7
protectedoverride voidOnUpdate(){
if(lastRequest!=targetPosition.value){
if(!agent.SetDestination(targetPosition.value)){
...
This can be tested easily on the default nodes – a Seek interrupting a Patrol. The seek will have to run twice, because Patrol’s OnStop will clear the path.
Thank you for posting the bug on the forums as well!
I will work on fixing this as soon as possible. It is one of those things that I keep omitting doing so.