How to tell a spawned object to follow a path?
by Murtaza · in Torque Game Builder · 02/23/2010 (7:14 am) · 0 replies
%tempBanana3 = new t2dStaticSprite()
{
imageMap = "bananaImageMap";
sceneGraph = %this.scenegraph;
class = Ban;
};
%tempBanana3.setPositionY(getWord(myBan.getLinkPoint(1), 1)+10);
%tempBanana3.setPositionX(getWord(myBan.getLinkPoint(1), 0));
%tempBanana3.setSize(1.587,3.157);
%tempBanana3.addToScene(scenegraph);
The above creates an object tempBanana3 of the class Ban, places it at a position, resizes it and adds to scene.
But how do I make that spawned object follow a curved path for a fixed distance and fixed speed after it is spawned? I tried using attachObject but can't make it work. The object just stays at the position it was spawned.
Thanks.
{
imageMap = "bananaImageMap";
sceneGraph = %this.scenegraph;
class = Ban;
};
%tempBanana3.setPositionY(getWord(myBan.getLinkPoint(1), 1)+10);
%tempBanana3.setPositionX(getWord(myBan.getLinkPoint(1), 0));
%tempBanana3.setSize(1.587,3.157);
%tempBanana3.addToScene(scenegraph);
The above creates an object tempBanana3 of the class Ban, places it at a position, resizes it and adds to scene.
But how do I make that spawned object follow a curved path for a fixed distance and fixed speed after it is spawned? I tried using attachObject but can't make it work. The object just stays at the position it was spawned.
Thanks.