Character Animation from Weapon
by University_Washington (#0009) · in Torque Game Engine · 02/24/2009 (1:02 am) · 5 replies
Is there any way to have not only the weapon animate upon "fire" but also the character/object holding the weapon to animate as well?
#2
03/01/2009 (4:46 pm)
Oh by the way, you will have to rem out the eyeOffset in your weapons datablock// eyeOffset = "0.21 0.42 -0.6";or your weapon won't be stuck to your hand in 1st person mode.
#3
But, there's one thing though. It seems that when I try to "fire" while I'm running, the animation I have playing is cut off. Any suggestions for settings of this animation? I.e. what properties for the sequence should I have (cyclical, complete sequence, blend, etc???)
03/20/2009 (4:04 am)
Thanks David! The advice worked great and I now have a great animation upon fire.But, there's one thing though. It seems that when I try to "fire" while I'm running, the animation I have playing is cut off. Any suggestions for settings of this animation? I.e. what properties for the sequence should I have (cyclical, complete sequence, blend, etc???)
#4
03/23/2009 (12:18 pm)
I don't think it has to do with the type of animation - Torque automatically stops action animations when the character is moving. You'd need to edit the source code to stop that happening. Try checking out the animation functions in player.cc - there's a comment somewhere about stopping action animations when we're going to move.
#5
search for,
But im not sure if that is the way we should be doing it, as by default really Weapon animations should not be canceled when your running around.
06/09/2009 (7:36 am)
its in Player.cpp in updateMove()search for,
// Cancel any script driven animations if we are going to move.
if (moveVec.x + moveVec.y + moveVec.z != 0.0f &&But im not sure if that is the way we should be doing it, as by default really Weapon animations should not be canceled when your running around.
Torque Owner David Robert Pemberton
www.deadlyassets.com
%obj.setActionThread("celwave");use whatever animation you have instead of 'celwave'to get your animation looking right you may have to put a call to your setActionThread in another of your state's
stateName[4] = "Reload"; stateTransitionOnNoAmmo[4] = "NoAmmo"; stateTransitionOnTimeout[4] = "Ready"; stateTimeoutValue[4] = 0.1; stateSequence[4] = "Reload"; stateScript[4] = "onReload"; ... ... function Weapon::onReload(%this, %obj, %slot) { %obj.setActionThread("celwave"); }where 'Weapon' is the name of your weapon & 'celwave' is the name of your recoil or whatever animation.hope this helps :)