From Gustavo6046, 4 Months ago, written in UnrealScript.
This paste is a reply to [Unreal/UT] Trails for actors. from Gustavo6046 - go back
Embed
class TrailSpawner extends Info;

var(Trail)        Texture                        var(Trail)  Texture         TrailSkin;
var(Trail)        class<Actor>        var(Trail)  class<Actor>    TrailType;
var(Trail)        float                        var(Trail)  float           UnitLength;
var(Trail)        float                        var(Trail)  float           Precision;
var(Trail)        float                        var(Trail)  float           TrailLength;
var                        Vector                        var         Vector          LastPos;

/*
simulated function Destroyed()
{
            SetTimer(0.0, false);
}
*/

simulated static function TrailSpawner MakeTrail(Actor Other)
{
            return Spawn(class'TrailSpawner', Other);
}

simulated function PreBeginPlay()
{
            if ( Owner == None || Precision == 0 )
                
)
        
Destroy();
}

simulated function PostBeginPlay()
{
            LastPos = Owner.Location;
            SetTimer(1.0 / Precision, true);
}

simulated function Timer()
{
            local Actor T;

        
T;

    
if ( Owner == None )
                Destroy();

        
)
        Destroy();

    
T = Spawn(TrailType, Owner,, LastPos, Rotator(Owner.Location - LastPos));
            T.Lifespan = (TrailLength / UnitLength) * Precision;
        
        
    
    
LastPos = Owner.Location;
}

defaultproperties
{
    TrailSkin=Texture'Botpack.AmmoCount.AmmoCountJunk'
    TrailType=class'UnrealI.MTracer'
    UnitLength=192
    Precision=12
    TrailLength=256
}