Game Development Community

t2dPath node addition question

by Brian Tan · in Torque Game Builder · 05/04/2009 (1:15 pm) · 0 replies

Hi,

I am trying to add a new node to an existing path that was set up in TGB but a weird issue crops up when I do that.
To start off, I made four nodes using a CUSTOM path type and the object has a WRAP follow mode. In the callback function onReachNode(), I call the moveTo() function for the moving object to move to the next node's position. It works for the initial four nodes that I set up in TGB.

When I called t2dPath.addNode(%worldPosition, 1) in onMouseDown(), it did insert the node in between the original node 0 and node 1.
The problem is that when the object that's travelling reaches a node (any node), it will just stop moving. I never get a callback function for a chance to change /update anything.
If I set a new endNode, it will restart from node 0, What I want is just for the object to keep moving from it's current position.
If I set the path type to LINEAR, the object will keep moving but the point is that I want to use the CUSTOM path type method.
Any suggestions?