Game Development Community

t2d Paths

by Hugo Munoz · in iTorque 2D · 07/06/2010 (7:39 pm) · 1 replies


Hey guys, is there a way to get the current node in a t2dPath ? The reason is because I have an object mounted a LINEAR path and I need to flip it when reaching the last node.

Any thoughts ?

Thanks

#1
07/06/2010 (8:49 pm)
Checking the C++ engine code I found the callback I was looking for, here is the code if somebody needs it:

function somePathClass::onReachNode(%this, %object, %node)
{
// if reached the last node, FLIP the object attached to it
if (%node == %this.getNodeCount())
{
%object.setFlip(true, false);
}
}