i do not enjoy the way i have made the SPUP class destroy itself when its owner dies because there must be a better way to do this...
Code: Select all
simulated event Touch(Actor Other)
{
if(Projectile(Other) != none && !Other.bDeleteMe)
{
Other.Destroy();
}
else if(TheOwnerOfThis!=None && Pawn(TheOwnerOfThis).Health<=0)
Destroy();
Anyone got some better suggestion for this? when player dies and match ends right away the spup class doesnt get destroyed, but if its in mid of a match it destroys fine...
Now for the real problems:
1)Is there really no way to get the team of the owner who fired the projectile which collides with the SPUP?
what i want is something like this if(Projectile(Other).Owner.Controller.GetTeamNum!=Pawn(TheOwnerOfThis).Controller.GetTeamNum) please help me make this statement work, i just want to block projectiles from the enemy team not my own team.
2)InstantHit bullets go through the touch event and damages the players inside the shield, how can i block instant hit bullets for this class? right now nothing is set in default properties for this class to block, nothing except the CollisionRadius=100 & CollisionHeight=100 & bIgnoreEncroachers=True & bUseCylinderCollision=True, and the projectile blocking is done by the touch event and nothing more.
Thanks in advance!