Code:
// When damaged (by a welder) , remove Mover and instate KFOBJMover Door to replace it. function TakeDamage( int Damage, Pawn instigatedBy, Vector hitlocation, Vector momentum, class<DamageType> damageType) { local KFOBJMover SDoor; if ( bClosed && damageType == class 'DamTypeBullpup' ) { Log ("A welding tool has sealed a door!"); // So it doesnt collide with the OBJ door we're about to spawn self.SetCollision(false,false,false); // Spawn KFOBJPawn in place of the Mover SDoor = Spawn(class'KFmod.KFOBJMover',,, self.Location , self.Rotation); SDoor.SetDrawScale(self.DrawScale); SDoor.SetDrawScale3D(self.DrawScale3D); Destroy(); } }
should be pretty run of the mill right? I've got checks in place to ensure that it sets the Spawned pawn's scale to the old mover's and it's in the same location, rotation etc. etc.
with ANY other object than a pawn, this code will work (i've tried.)
But it says in my Log (SDoor = none) and ends up failing to spawn every time, with my class extended from xpawn
any thoughts?
(I also did some tests spawning a KFOBJMover by the same method, on another KFOBJMover, and it worked...so i dunno if this is just a mover issue or what)
Comment