Tile - YAnimators - Follow – Ylands

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 10: Line 10:


==== obj ====
==== obj ====
Target object to be moved


==== targetObject ====
==== targetObject ====
Target object to be followed


==== offset ====
==== offset ====
Position offset from the target object (vector)


==== offsetIsRelative ====
==== offsetIsRelative ====
Whether is the offset relative to the target orientation


==== maxSpeed ====
==== maxSpeed ====
Maximum movement speed (m/s)


==== acceleration ====
==== acceleration ====
Movement acceleration (m/s^2)


==== distanceToStartMovement ====
==== distanceToStartMovement ====
Minimal distance from target to resume the movement (meters)


==== distanceToEndMovement ====
==== distanceToEndMovement ====
Maximal distance from target to end the movement (meters)
=== Availability ===
[[Ylands:Tile Availability - Server|Server]]


=== Description ===
=== Description ===


Selected '''animated object''' will follow the '''target'''.
Moves selected '''animated object''' towards '''target''' object.


=== Notes ===
=== Notes ===


* Offset can be set as relative, that will apply the offset in the objects local space (takes into account the objects rotation)
* 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''
* The movement 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
* Every time the follow stops or starts, '''animator events''' are spawned



Revision as of 12:15, 12 November 2021

Follow(Object, Target, Target offset, Relative offset, Max speed, Acceleration, Distance to start, Distance to end)

YlandsTile-606.png

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

Target object to be moved

targetObject

Target object to be followed

offset

Position offset from the target object (vector)

offsetIsRelative

Whether is the offset relative to the target orientation

maxSpeed

Maximum movement speed (m/s)

acceleration

Movement acceleration (m/s^2)

distanceToStartMovement

Minimal distance from target to resume the movement (meters)

distanceToEndMovement

Maximal distance from target to end the movement (meters)

Availability

Server

Description

Moves selected animated object towards target object.

Notes

  • Offset can be set as relative, that will apply the offset in the objects local space (takes into account the objects rotation)
  • The movement 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