Path Callbacks Not Triggering
by David Mulkerrins · in Torque Game Builder · 03/02/2010 (9:08 am) · 2 replies
I've created a path and added some nodes to it and then created a sprite and mounted it to the path. Also I've assigned the path a class name, this all using the torque editor (v1.7.4). The Sprite follows the path and all works fine.
The problem is in the scripting where I'm trying to use the path callbacks (onUpdatePath and onReachNode) but for whatever reason they never get triggered.
The path object has the class name "somePathClass" and the code below is what I'm using:-
function somePathClass::onUpdatePath(%this, %object, %from, %to)
{
echo("onUpdatePath triggered!");
}
function somePathClass::onReachNode(%this, %object, %node)
{
echo("onReachNode triggered!");
}
I've also tried this with assigning a name and not a class instead for the path object but to no avail. Is there something I'm doing wrong or does something need to be enabled / disabled first?
The problem is in the scripting where I'm trying to use the path callbacks (onUpdatePath and onReachNode) but for whatever reason they never get triggered.
The path object has the class name "somePathClass" and the code below is what I'm using:-
function somePathClass::onUpdatePath(%this, %object, %from, %to)
{
echo("onUpdatePath triggered!");
}
function somePathClass::onReachNode(%this, %object, %node)
{
echo("onReachNode triggered!");
}
I've also tried this with assigning a name and not a class instead for the path object but to no avail. Is there something I'm doing wrong or does something need to be enabled / disabled first?
About the author
Recent Threads
#2
I see how it works now. The onReachNode gets triggered each time the mounted object touches a node and the onUpdatePath only works if the path type is set to 'CUSTOM' in the editor, as that option enables the callback.
Thanks for the help, least now I know I was coding it correctly to begin with. :)
03/03/2010 (3:31 am)
Yep, I forgot to update it in the main.cs when I changed the filename of the script earlier, doh! I see how it works now. The onReachNode gets triggered each time the mounted object touches a node and the onUpdatePath only works if the path type is set to 'CUSTOM' in the editor, as that option enables the callback.
Thanks for the help, least now I know I was coding it correctly to begin with. :)
Torque Owner Shaderman