Game Development Community

Cannot get back to Root animation

by Dave Dunlap · in Artist Corner · 02/17/2005 (7:33 am) · 1 replies

I am having problems getting back to the root animation after I set the action of a player to another animation (i.e. run). I am not keying of any keyboard or mouse bindings. I use the following code to set the action:

bool Player::setActionThread(const char* sequence,bool hold,bool wait,bool fsp)
{
for (U32 i = 1; i < mDataBlock->actionCount; i++) {
PlayerData::ActionAnimation &anim = mDataBlock->actionList[i];
if (!dStricmp(anim.name,sequence)) {
setActionThread(i,true,hold,wait,fsp);
setMaskBits(ActionMask);
return true;
}
}
return false;
}

To set the back to the root animation I tried this:

void Player::setRootAction()
{
setActionThread(PlayerData::RootAnim,true, false, false, false, false);
setMaskBits(ActionMask);
}

But this does not set the action back to root. Any thoughts?

#1
02/26/2005 (2:16 pm)
Have you tried setting the action thread to "idle" instead of root? This is one of those areas where I always end up just fiddling with the code for a bit until it does what I want.

You might also try reposting this in one of the Torque forums. This post is far, far from where it should be to get answered.