Category Archives: Tutorials

[Code] Heartbeat sound when life is low


Big Thanks to Crusha K. Rool and 100GPing100 from UDK Forums.

Use this code in your custom Pawn class:

class MyNewPawn extends UTPawn;
var AudioComponent HealthSound;

event TakeDamage(int DamageAmount, Controller EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType, optional TraceHitInfo HitInfo, optional Actor DamageCauser)
{
    super.TakeDamage(DamageAmount, EventInstigator, HitLocation, Momentum, DamageType, HitInfo, DamageCauser);
    if (Health <= 25)
    {
        HealthSound.Play();
    }
}

function Tick(float DeltaTime)
{
    Super.Tick(DeltaTime);

    if (Health > 25)
         HealthSound.Stop();
}

simulated event Destroyed()
{
    HealthSound = None;
    super.Destroyed();
}

defaultproperties
{
    Begin Object class=AudioComponent name=MenuAudioComponent
        SoundCue = SoundCue'Sounds.Misc.Heartbeat_Cue' //Change this to your soundcue.
    End Object
    HealthSound = MenuAudioComponent
    Components.Add(MenuAudioComponent)
}

[Tutorial] Change Player Mesh via Kismet


Hello everyone…In this tutorial you will learn to change Player Mesh by pressing any button in-game. We achieve this by using a custom Kismet Node.

Read the rest of this entry

Design a site like this with WordPress.com
Get started