Tile - YAnimators - Follow – Ylands
Jump to navigation
Jump to search
Follow(Object, Target, Target offset, Relative offset, Max speed, Acceleration, Distance to start, Distance to end)
static follow(obj: YEntity | YLogic | YGroup, targetObject: YEntity | YLogic | YGroup, offset: YVector3, offsetIsRelative: boolean, maxSpeed: number, acceleration: number, distanceToStartMovement: number, distanceToEndMovement: number): void;
Parameters
obj
targetObject
offset
offsetIsRelative
maxSpeed
acceleration
distanceToStartMovement
distanceToEndMovement
Description
Selected animated object will follow the target.
Notes
- Offset can be set as relative, that will apply the offset in the objects local space (takes into account the objects rotation)
- The follow instruction will stop when it reaches the distance to end, and start again when the distance is greater than distance to start
- Every time the follow stops or starts, animator events are spawned