×
Меню
Индекс

MSFD Making an object spin

Similar to the movements described above, you can also rotate objects, around either their local or the world axis and determine the current angle:
 
Rotate , axis, angle/sec_enum
 
RotateWorld, axis, angle/sec_enum
 
Rotate, z, -30; rotate counterclockwise, 30° per second, around objects z axis
Object_ID->Rotate, Y, 100
 
Axis can be x, y, or z. Notice that like the move functions the value you are giving Rotate or RotateWorld is a speed setting (not an angle), if you want to turn an object by 90% either use set angle (for an instantaneous change) or use Rotate together with GetAngle to check how far the object has already been turned. These functions can not be used with Actors.
 
RotateWorld does NOT update an item's position.
If you use RotateWorld in a script, and then call GetAngle, it will always return the same value, regardless of what the angle actually is. Just using rotate does not cause this problem.
(Forum info / HeyYou)