Time for action – SHOOT NOW!
Once again, instead of jumping right in and creating enemies with AI and attacks and health and long complicated pieces of code, let's start with something simple: A box we can shoot at and kill.
Create a new file in our
Development/Scr/AwesomeGame/Classes
folder and call itTestEnemy.uc
. This way we'll know it's not a class we'll be keeping. Copy the following code into it:class TestEnemy extends AwesomeActor placeable; event TakeDamage(int DamageAmount, Controller EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType, optional TraceHitInfo HitInfo, optional Actor DamageCauser) { Destroy(); } defaultproperties { bBlockActors=True bCollideActors=True Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment bEnabled=TRUE End Object Components.Add(MyLightEnvironment) Begin Object Class=StaticMeshComponent Name=PickupMesh StaticMesh=StaticMesh'UN_SimpleMeshes...