Purchased NodeCanvas in the recent sale and have just started to mess around with the official example scenes provided (in particular the FSM Character Point and Click Control scene).
I noticed that when you click the mouse the character starts moving towards that point. However, if you click the mouse again somewhere else while the character is still moving to the first point the click is ignored and the character continues to the original destination.
To allow the character’s movement to be interrupted by a mouse click (so they immediately change direction and head to the new destination) I updated the graph per the attached image.
Essentially I just copied the existing ‘click’ connection (transition?) and looped it from the Move state back to itself.
It works, but as a newcomer to NodeCanvas, I’m interested to know whether this would be considered the ‘correct’ way to implement such a behaviour.
Yes, this is a very correct solution if you want to do that 🙂
Another solution would be to link the “Move” state from an AnyState node along with the same transition condition that you already made. This would make the “Move” state trigger regardless of the current state (since AnyState transitions are evaluated per-frame).