obj.ApplyVelocity() - originalfoo/Prison-Architect-API GitHub Wiki
##Overview
The .ApplyVelocity() method can be used to create a shunt of movement (and optionally some rotation) in a specific direction.
##Syntax
someObj.ApplyVelocity( <velX>, <velY> [, <rotate>] )Where:
-
<velX>and<velY>are numbers defining the velocity along thexandyaxes respectively- Positive
<velX>is North, negative is South - Positive
<velY>is East, negative is West
- Positive
-
<rotate>is an optional parameter; iftruethen it will apply some mild rotation- defaults to
false
- defaults to
##Example
someObj.ApplyVelocity( 2.0, 5.0, false )##Notes
Rotation, if used, will be applied around the centre of your object. If you update the rotation whilst the animation is active, the animation will stop instantly.
The velocity values are applied from a south-facing perspective (ie. ignoring any rotation of the object). If you update the velocity whilst it is being animated, it will continue to be animated but the rotational animation (if applied) may be lost.
##See Also
-
data/scripts/: -
data/materials.txt:-
Height- negative value flips vertically MoveCostMoveSpeedFactorRotatableRotateType-
Width- negative value flips horizontally
-