Simple Animation
by Howard Dortch · in Torque Game Engine · 06/24/2009 (12:47 pm) · 2 replies
I have a dts object and all I want to do is raise and lower an antenna. I created the model, tied the antenna object to a node and animated it, 30 frames and 30 fps. All is well, I put it in game and call radio.PlayThread(0,"raise") and the antenna goes up just fine. Now I want to lower it so I assumed I can just call radio.setThreadDir(0,false) then call radio.PlayThread(0,"raise") and it will lower the antenna. It wont work properly. I also tried radio.stopThread(0) but the antenna just goes back to the frame 0 position or lowered instantly. Should I make another animation called "lower" or can I just get away with setting directions?
Anyone help ?
Anyone help ?
#2
Something like...
Door Resource
06/25/2009 (9:14 am)
Tom Feni did a Door Resource that is similar to what you want. The door animation only opens, but the script reverses it (I think).Something like...
if (!%door.open)
{
%door.open=true;
%door.setthreaddir(0,"true");
%door.playthread(0,"open");
}
else
{
%door.setthreaddir(0,"false");
%door.open=false;
}Door Resource
Torque Owner Ivan Mandzhukov
Liman3D
Also check your animation. Is it cyclic ?