Anim not played in FP?
by Jari · in Torque Game Engine · 09/22/2006 (7:27 pm) · 10 replies
Hi,
I used this code to play an animation on the player object and it works fine except one thing:
If I'm in first person view the animation probably isn't played and when I switch to 3rd person I can then see that the shape is in fact on it's root state.
I know this because if Im in the 3rd person view and then play the animation then the anim will play and stop leaving the shape to the last frame of the animation (which is what I want). This is because I'm not calling stopThread().
Any ideas why the animation isn't played in first person?
Thanks!
I used this code to play an animation on the player object and it works fine except one thing:
%player.playThread(0, "carryBox");
If I'm in first person view the animation probably isn't played and when I switch to 3rd person I can then see that the shape is in fact on it's root state.
I know this because if Im in the 3rd person view and then play the animation then the anim will play and stop leaving the shape to the last frame of the animation (which is what I want). This is because I'm not calling stopThread().
Any ideas why the animation isn't played in first person?
Thanks!
#2
s hands reaching forward (as in carrying a box). But if it's played in FP then the hands are not left on the proper position (not in last frame).
So I dont know does it play in FP or not but the mesh/shape anim transform is not left according to the last frame, unlike in 3rd person mode
09/23/2006 (9:59 am)
Tim, what I'm wondering is that when the animation is played in 3rd person the animation stops at the last frame - as supposed - leaving the humans hands reaching forward (as in carrying a box). But if it's played in FP then the hands are not left on the proper position (not in last frame).
So I dont know does it play in FP or not but the mesh/shape anim transform is not left according to the last frame, unlike in 3rd person mode
#3
09/23/2006 (11:26 am)
I believe these have to be two seperate animations, but I am not sure. The Skeleton pack has a great combo of third and first person animations that are used to create a complete package. I would check out how Andy Hawkins did it with his animations.
#4
09/24/2006 (12:55 pm)
Hmm, ok thanks Jon, I guess that pack costs though.
#5
Does any one know why the root animation is not played anymore (at least not properly) after playing and animation using playThread() and then stopThread() ?
The animation is stuck in the last frame even the root animation (which is cyclic) overrides all the nesessary bone transforms.
Btw, Is there any documentation on how to use playThread and others? I cannot find any docs.
Thank you.
10/05/2006 (8:39 pm)
Edit: Nevermind I studied the engine code and found out the reason, thread is not deleted after it finishes playing so it keeps overriding the root anim.Does any one know why the root animation is not played anymore (at least not properly) after playing and animation using playThread() and then stopThread() ?
The animation is stuck in the last frame even the root animation (which is cyclic) overrides all the nesessary bone transforms.
Btw, Is there any documentation on how to use playThread and others? I cannot find any docs.
Thank you.
#6
Does any one know a fix for this, or some work around?
11/04/2006 (11:51 pm)
I still have the problem that if you are in first person the animation is not played and it's played only when in third person. This wouldn't be a problem if the game's character scripts wouldn't rely on the onSequence played function calls, which are not called when in first person.Does any one know a fix for this, or some work around?
#7
11/05/2006 (3:25 am)
Animations are played in both perspectives as there is no logic inside Torque that seperates the two in terms of animations. playThread has had issues on player objects for as long as I can remember.
#8
Just a guess, but is your player's body set to render in first person mode? If not, then you won't be able to see the character's animation in 1st simply because the body isn't being drawn. By default, only the mounted weapon is shown in first person, nothing else. However, that's easy to fix.
Open up player.cs and look for this block of script . . .
Once you've found it, change the renderFirstPerson setting to true and that should solve your problem.
I hope this helps.
11/05/2006 (6:21 am)
Jari,Just a guess, but is your player's body set to render in first person mode? If not, then you won't be able to see the character's animation in 1st simply because the body isn't being drawn. By default, only the mounted weapon is shown in first person, nothing else. However, that's easy to fix.
Open up player.cs and look for this block of script . . .
datablock PlayerData(PlayerBody)
{
renderFirstPerson = false;
emap = true;Once you've found it, change the renderFirstPerson setting to true and that should solve your problem.
I hope this helps.
#9
Arron, thank you, but I knew that and unfortunately it doesn't solve the problem.
I suppose you just have to dig in the code and fix this somehow.
11/05/2006 (6:54 pm)
Stefan, ok thanks for the info, it's good to know that the problem isn't just in my copy of the code (which maybe modified).Arron, thank you, but I knew that and unfortunately it doesn't solve the problem.
I suppose you just have to dig in the code and fix this somehow.
#10
11/06/2006 (7:46 am)
Here's something I don't understand about this 'quirk' in TGE[I've struggled with myself, Stefan], is that if there is up to 4 Animation Threads running at once possible[you can run/look at once and perhaps 2 more...????], why is it then, that the ONE sequence on this one Thread[playThread function] manages to hijack the entire character?? Trying to run playThread on the player is frustrating...having the Thread not deleted or reset[once run as called] seems absurd?! Anyone?
Torque Owner Tim Heldna