Tile - YAnimators - Follow – Ylands

From Bohemia Interactive Community
Jump to navigation Jump to search
m (YlandsClassyBot moved page Ylands Tile - Follow object to Ylands:Tile - YAnimators - Follow: New Structure)
No edit summary
Line 1: Line 1:
[[Image:Follow object.png]]
<!---
*'''Animation''' script tile, which moves selected '''object''' to '''target'''.
THIS PAGE WAS GENERATED AUTOMATICALLY; DO NOT EDIT IT, OTHERWISE YOUR CHANGES WILL BE LOST DURING FUTURE UPDATE.
*Both '''object''' and '''target''' can be entity, group or game logic.
-->
*'''Target offset''' defines offset of the '''followed''' object position. Further defined by the '''relative offset''' option.
== Follow(Object, Target, Target offset, Relative offset, Max speed, Acceleration, Distance to start, Distance to end) ==
*'''Max speed''' and '''acceleration''' define the velocity properties of the animation.
 
*'''Distance to start/stop''' sets when the distance is big enough to start following or small enough to stop following.
[[File:YlandsTile-606.png]]
 
<pre>static follow(obj: YEntity | YLogic | YGroup, targetObject: YEntity | YLogic | YGroup, offset: YVector3, offsetIsRelative: boolean, maxSpeed: number, acceleration: number, distanceToStartMovement: number, distanceToEndMovement: number): void;</pre>
=== 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
 


----
----
Line 11: Line 41:


[[Category: Instructions]]
[[Category: Instructions]]
[[Category: Ylands 0.13]]

Revision as of 09:51, 8 July 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

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