home *** CD-ROM | disk | FTP | other *** search
/ Game Level Design / GLDesign.bin / Software / UnrealEngine2Runtime / UE2Runtime-22262001_Demo.exe / Gameplay / Classes / ACTION_TeleportToPoint.uc < prev    next >
Text File  |  2003-12-11  |  639b  |  25 lines

  1. class ACTION_TeleportToPoint extends LatentScriptedAction;
  2.  
  3. var(Action) name DestinationTag;    // tag of destination - if none, then use the ScriptedSequence
  4. var(Action) bool bPlaySpawnEffect;
  5.  
  6. var Actor Dest;
  7.  
  8. function bool InitActionFor(ScriptedController C)
  9. {
  10.     local Pawn P;
  11.     Dest = C.SequenceScript.GetMoveTarget();
  12.  
  13.     if ( DestinationTag != '' )
  14.     {
  15.         ForEach C.AllActors(class'Actor',Dest,DestinationTag)
  16.             break;
  17.     }
  18.     P = C.GetInstigator();
  19.     P.SetLocation(Dest.Location);
  20.     P.SetRotation(Dest.Rotation);
  21.     P.OldRotYaw = P.Rotation.Yaw;
  22.     if ( bPlaySpawnEffect )
  23.         P.PlayTeleportEffect(false,true);
  24.     return false;    
  25. }