×
Меню
Индекс

MSFD Moving along the world axis

MoveWorld axis(x/y/z), units/sec_enum
 
MoveWorld z, 100
Object_ID->MoveWorld Z, 30
 
Moves the object along the selected world axis (x, y, or z) at the speed selected. This speed is in units per second (21.3 units per foot). This movement is based on the world axis, thus a positive z movement will always move the object up, regardless of its local rotation: In world coordinates Z is always up / down (increasing upwards), X is east / west (increasing to east) and Y is north / south (increasing to north).
 
 
Note: MoveWorld will not work on Actors, including the player. Use SetPos for actors.
 
This is an example after a script I once picked up on the forums that makes a platform slowly move out and back once the player stands on it:
 
Begin platform_script
 
Short PlatformMoving
Short ActivateMe
Float Timer
 
If ( GetStandingPC == 1 )
     Set ActivateMe to 1
Endif
 
If ( ActivateMe == 1 )
     If ( PlatformMoving == 0 )
          Set Timer to Timer + GetSecondsPassed
          If ( Timer <= 15 )
               "floating_platform_01"->MoveWorld X 10
          Else
               Set Timer to 0
               Set PlatformMoving to -1
          Endif
     Endif
     If ( PlatformMoving == -1 )
          Set Timer to Timer + GetSecondsPassed
          If ( Timer <= 15 )
               "floating_platform_01"->MoveWorld X -10
          Else
               Set Timer to 0
               Set PlatformMoving to 0
               Set ActivateMe to -1
          Endif
     Endif
Else
     "floating_platform_01"->SetAtStart    
Endif
 
End platform_script