Game Development Community

Need Helps :Simple shape animation.

by MARIA SALAZAR · in Artist Corner · 06/19/2008 (1:09 am) · 2 replies

My animation is working fine in torque.exe -show and ShowTool but it is not working in the engine.

this is my code

datablock StaticShapeData(myball)
{
category = "myBall";
shapeFile = "~/data/shapes/superbomb/myball.dts";
};

function StaticShapeData::create(%block)
{
%obj = new StaticShape()
{
dataBlock = %block;
};
return(%obj);
}

function myball::onAdd(%this,%obj)
{
%obj.playThread(0,"root");
}



and I also try to call .dsq by using TSShapeConstructor and It is not working too.

datablock TSShapeConstructor(myball)
{
baseShape = "~/data/shapes/superbomb/myball.dts";
sequence0 = "~/data/shapes/superbomb/myball_root.dsq root";
};


datablock StaticShapeData(myball)
{
category = "myBall";
shapeFile = "~/data/shapes/superbomb/myball.dts";
};

function StaticShapeData::create(%block)
{
%obj = new StaticShape()
{
dataBlock = %block;
};
return(%obj);
}

function myball::onAdd(%this,%obj)
{
%obj.playThread(0,"root");
}

I bring myBall from shapes tree in the world editor and it is not moving at all and I type playThread in the console. It said "unable to find funtion playThread" I walk thru this forum and I still cannot make it. Pleas help me. Thank you

#1
07/31/2008 (11:33 am)
Using the top code it all looks good already but i would check the name of the sequence, i believe that might be your problem. during the exporting process whatever you called the animation in your program you have to call it in the code so it may be myball_root but im not sure if this is exactly right
#2
07/31/2008 (3:11 pm)
Thank you for your help. I figured out already. It worked after I removed TSShape datablock.