Checking if collision still persists?
Posted: Sat 29 Oct , 2011 5:38 am
Hey all im trying: when a player touches a specific actor, it triggers the touch event, that touch event will then offer that specific actor a item, the item should destroy itself right away if the player exists that actor area (the actor can be trespassed by players but not by bullets, this is similar to the shield i was making before), what i want now, is for when the item no longer detects its owner inside that actor to destroy itself, is there any event for this? right now i have tried it with a looping timer, and when timer is ticked and player is no longer in, the item (which is based on a subclass of an inventory class) will auto destroy itself.
The problem is not even this way it works, because im almost sure there must be something syntaxically incorrect, wheres what i have:
shield like actor:
And the item:
The item extends armor: and here is the full tree
Core.Object
|
+-- Engine.Actor
|
+-- Engine.Inventory
|
+-- Engine.Powerups
|
+-- Engine.Armor
Any ideas? Thanks in advance!
EDIT:SSSP1 is the item, sorry for forgeting that.
The problem is not even this way it works, because im almost sure there must be something syntaxically incorrect, wheres what i have:
shield like actor:
Code: Select all
var Actor TheOwnerOfThis; (the player)
var Actor ProtectionOwner: (the shield)
simulated event Touch(Actor Other)
if(TheOwnerOfThis!=None && Pawn(TheOwnerOfThis).Health<=0)
Destroy();
else if(Pawn(Other).GetTeamNum()==Pawn(TheOwnerOfThis).GetTeamNum() && Pawn(Other).Health>0 && Pawn(Other)!=Pawn(TheOwnerOfThis))
SSSP1=Pawn(Other).spawn(class'DreamsProtectionShield1A', Pawn(Other).Controller,,Pawn(Other).Location);
SSSP1.giveto(Pawn(Other));
SSSP1.ProtectionOwner=self;
SSSP1.TheOriginalOwner=TheOwnerOfThis;
}
Code: Select all
var Actor TheOwnerOfThis;
simulated function Timer()
{
if(Pawn(Owner)!=None && Pawn(Owner).TouchingActor(ProtectionOwner)==false && Pawn(Owner)!=Pawn(TheOriginalOwner))
Destroy();
}
Core.Object
|
+-- Engine.Actor
|
+-- Engine.Inventory
|
+-- Engine.Powerups
|
+-- Engine.Armor
Any ideas? Thanks in advance!
EDIT:SSSP1 is the item, sorry for forgeting that.