daimaku
07-28-2011, 08:58 PM
hi i'm trying to spawn an item when my enemy die, the spawn is working right, but the issue is that i'm using the last location of the enemy to spawn the item, but when the item is spawned the item seems to be geting the location of the player and updating it, i have tried many things but the result is the same, here is a video too show the problem
http://www.youtube.com/watch?v=dqoFJPvGeuM
and here is the code that i'm using to spawn the item
function bool Died(Controller Killer, class<DamageType> damageType, vector HitLocation)
{
local vector SpawnLoc;
local class<actor> NewClass;
SpawnLoc=Location;
SpawnLoc.Z=20;
NewClass = class<actor>( DynamicLoadObject( ***ame.FA_Key, class'Class' ) );
if( NewClass!=None )
{
Spawn( NewClass,,,SpawnLoc );
}
return super.Died(Killer, damageType, HitLocation);
}
this code is in my enemy custom pawn class and is extending from UTPawn, any idea on why the spawn items is acting this way ?
thanks in advance for all the help.
http://www.youtube.com/watch?v=dqoFJPvGeuM
and here is the code that i'm using to spawn the item
function bool Died(Controller Killer, class<DamageType> damageType, vector HitLocation)
{
local vector SpawnLoc;
local class<actor> NewClass;
SpawnLoc=Location;
SpawnLoc.Z=20;
NewClass = class<actor>( DynamicLoadObject( ***ame.FA_Key, class'Class' ) );
if( NewClass!=None )
{
Spawn( NewClass,,,SpawnLoc );
}
return super.Died(Killer, damageType, HitLocation);
}
this code is in my enemy custom pawn class and is extending from UTPawn, any idea on why the spawn items is acting this way ?
thanks in advance for all the help.