From Gustavo6046, 2 Weeks ago, written in UnrealScript.
Embed
  1. class TrailSpawner extends Info;
  2.  
  3. var(Trail)      Texture                 TrailSkin;
  4. var(Trail)      class<Actor>    TrailType;
  5. var(Trail)      float                   UnitLength;
  6. var(Trail)      float                   Precision;
  7. var(Trail)      float                   TrailLength;
  8. var                     Vector                  LastPos;
  9.  
  10. /*
  11. simulated function Destroyed()
  12. {
  13.         SetTimer(0.0, false);
  14. }
  15. */
  16.  
  17. simulated static function TrailSpawner MakeTrail(Actor Other)
  18. {
  19.         return Spawn(class'TrailSpawner', Other);
  20. }
  21.  
  22. simulated function PreBeginPlay()
  23. {
  24.         if ( Owner == None || Precision == 0 )
  25.                 Destroy();
  26. }
  27.  
  28. simulated function PostBeginPlay()
  29. {
  30.         LastPos = Owner.Location;
  31.         SetTimer(1.0 / Precision, true);
  32. }
  33.  
  34. simulated function Timer()
  35. {
  36.         local Actor T;
  37.  
  38.         if ( Owner == None )
  39.                 Destroy();
  40.  
  41.         T = Spawn(TrailType, Owner,, LastPos, Rotator(Owner.Location - LastPos));
  42.         T.Lifespan = (TrailLength / UnitLength) * Precision;
  43.        
  44.         LastPos = Owner.Location;
  45. }
  46.  
  47. defaultproperties
  48. {
  49.     TrailSkin=Texture'Botpack.AmmoCount.AmmoCountJunk'
  50.     TrailType=class'UnrealI.MTracer'
  51.     UnitLength=192
  52.     Precision=12
  53.     TrailLength=256
  54. }

Replies to [Unreal/UT] Trails for actors. rss

Title Name Language When
[UE1] Trails (indentfix) Gustavo6046 uscript 2 Weeks ago.