PDA

View Full Version : Remove Spinning Camera on Death



Icaroto
04-19-2012, 09:44 PM
Yo guys, one question:

My Pawn has the code:



simulated function PlayDying(class<DamageType> DamageType, vector HitLoc)
{
DeathAnimSlot = AnimNodeSlot(Mesh.FindAnimNode('DeathSlot'));
SetCollisionType(COLLIDE_NoCollision);
DeathAnimSlot.SetActorAnimEndNotification(true);
DeathAnimSlot.PlayCustomAnim('DeathI', 1.0, 0.05, -1.0, false, false);
LifeSpan=1.0;
}



But when I use a Modify Health to kill him, the camera change for 1st view and start to spinning... and because of that I think my death anim isn't playing...

My guess is that camera comming from the function PlayDying of UTPawn... but my function isn't suposse to "overide" the original one? (My pawn extends the UTPawn)

Anyway... I just want to remove that default spinning camera and show my death anim...


Thanks ^^

slowJusko
04-20-2012, 01:06 AM
PlayDying handles the animation and other settings.
Check out the dead state in UTPlayerController & dying state in UTPawn for the camera.

Icaroto
04-20-2012, 11:51 PM
WoW! Thanks! Thats work (I remove the CalcCamera from State Dying in UTPawn...

Now my PlayDying works!

But now I have another question... my code is this:


simulated function PlayDying(class<DamageType> DamageType, vector HitLoc)
{

local class<UTDamageType> UTDamageType;
UTDamageType = class<UTDamageType>(DamageType);

if (UTDamageType == None){
DeathAnimSlot = AnimNodeSlot(Mesh.FindAnimNode('DeathSlot'));
DeathAnimSlot.PlayCustomAnim('DeathI', 1.0, 0.05, -1.0, false, false);
super.PlayDying(DamageType,HitLoc);
}

}


If I have another type of damage in my Modify Health (for now it is set to "None") how I set the "UTDamageType =="

I mean... lets suppose that my Modify Health has Damage Type = UTDamage_1 on kismet instead of "None"

So, How can I compare What came from UTDamage with the others type of damage... something like that:

if (UTDamageType == None){
DO
}else if (UTDamageType == UTDamage_1){
DO
}

How to compare the Damage that I receive with the others that I have created to do differents stuffs


Thanks Again!

slowJusko
04-21-2012, 08:57 AM
Could do it by class name, a variable etc.


if (UTDamageType == None)
{
do this this and this
}
else if (MyDamageType(UTDamageType) != None)
{
do this this and that
}


It is up to you.