Hello there this is Darren and I’m Team Helios awesome kismet scripters, even through the other members are too bashful to tell me face to face. As my first post to this blog I thought I should provide everyone with an Unreal Script developed for our game if anyone else in game design was looking for the same result.

In our game we have sections where objects fall and hurt the player when they make contact with them. So we need the actor to spawn in, destroy itself when it hurts the player, and have a life span long enough to reach the player from whatever height the object was spawning from. Aside from the static meshes uses many of the falling objects in our game extended off this one script and I hope it will help other game designers in their endeavors:

class FallingActor extends KActorSpawnable placeable;

var() int myDamage;
var() class<DamageType> myDamageType;

 event Bump(Actor Other, PrimitiveComponent OtherComp, Vector HitNormal)
{
       Super.Bump(Other,OtherComp,HitNormal);

       if(Pawn(Other)!=none && !Pawn(Other).bDeleteMe) //Is it a pawn?
      
{
            self.Destroy();
       }

       Pawn(Other).TakeDamage(myDamage, None, Other.Location, Other.Velocity, myDamageType,, Self);
}

event RanInTo(Actor other)
{
       Super.RanInto(Other);

       if(Pawn(Other)!=none && !Pawn(Other).bDeleteMe) //Is it a pawn?
       {
            self.Destroy();
       }

       Pawn(Other).TakeDamage(myDamage, None, Other.Location, Velocity, myDamageType,, Self);
}

defaultproperties
{
       Begin Object Name=StaticMeshComponent0
             StaticMesh=StaticMesh'PhysTest_Resources.RemadePhysBarrel'
              BlockNonZeroExtent=True
              BlockZeroExtent=True
              BlockActors=True
              CollideActors=True
              AlwaysCheckCollision=true
       End Object

       bWakeOnLevel
       bNoEncroachCheck=False
       LifeSpan= 5.0
      
       myDamage=10
       myDamage'DmgType_Crushed'
}




Leave a Reply.