Game Development Community

Using a trigger to 'trigger' an animation

by Kevin Turchik · in Torque Game Engine Advanced · 12/15/2008 (12:31 pm) · 1 replies

Hi im pretty new to torque game engine advanced. I've used worldcraft/hammer before so bit of a difference.
I'm trying to use a trigger field to make an .dts object play its animation.
I have the trigger working so that it reads me walking through it but cant figure out how to make it play an animation.
Heres my code at the moment:(...My_Project\game\scriptsAndAssets\server\scripts\mytrigger.cs)

datablock TriggerData( mytrigger )
{
tickPeriodMS = 1000;
};
function addTrigger()
{
%obj=new Trigger (){
positioin = "100 100 100";
scale = "1 1 1";
rotation = "0 0 1 0";
datablock = "mytrigger";
polyhedron = "0 0 0 1 0 0 0 -1 0 0 0 1";
};
}
function mytrigger::onEnterTrigger( %this, %trigger, %obj )
{
$InRange = true;
echo("In range.");

}

function mytrigger::onLeaveTrigger( %this, %trigger, %obj )
{
$InRange = true;
echo("outta here.");
}
---------------------------
I used David Sushil's instructions for the above, but couldnt do the rest of his instructions.

my .dts animated object is elbow2.dts(\My_Project\game\scriptsAndAssets\data\shapes\mine\elbow2.dts)
I exported the animation and model together out of maya 2008
its animation is sequence_bend

do i need to create a data block for it too? im confused
thanks,
Kevin