Niandi
04-09-2012, 01:00 PM
Hi guys,
I've been trying to call an animation from code for a while now, and getting totally stumped by it. Right now my AnimTree is working with all the movement/death/attacks absolultely fine, not a problem. However I've been trying to call a 'TakeDamage' anim and I can't see anywhere in the AnimTree where 'TakeDamage' animations are naturally being handled.
I found a piece of code in UDK that says you can play a custom animation using code.. I've been trying this with no luck.
This is what I've been doing so far.
event TakeDamage(int Damage, Controller EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType, optional TraceHitInfo HitInfo, optional Actor DamageCauser)
{
FullBodyAnimSlot.PlayCustomAnim('SK_Human_damage_A nim', 10.0, 1.0, 0.0, false, false);
Super.TakeDamage(Damage, EventInstigator, HitLocation, Momentum, DamageType, HitInfo, DamageCauser);
}
There is literally no effect by doing this unfortunately... Does anyone have any idea what I'm doing wrong? (By the way I've connected the 'Take_Damage' anim in the AnimTree under 'Custom').
Thanks!
I've been trying to call an animation from code for a while now, and getting totally stumped by it. Right now my AnimTree is working with all the movement/death/attacks absolultely fine, not a problem. However I've been trying to call a 'TakeDamage' anim and I can't see anywhere in the AnimTree where 'TakeDamage' animations are naturally being handled.
I found a piece of code in UDK that says you can play a custom animation using code.. I've been trying this with no luck.
This is what I've been doing so far.
event TakeDamage(int Damage, Controller EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType, optional TraceHitInfo HitInfo, optional Actor DamageCauser)
{
FullBodyAnimSlot.PlayCustomAnim('SK_Human_damage_A nim', 10.0, 1.0, 0.0, false, false);
Super.TakeDamage(Damage, EventInstigator, HitLocation, Momentum, DamageType, HitInfo, DamageCauser);
}
There is literally no effect by doing this unfortunately... Does anyone have any idea what I'm doing wrong? (By the way I've connected the 'Take_Damage' anim in the AnimTree under 'Custom').
Thanks!