Tile - YAnimators - Follow – Ylands

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Text replacement - "{{DEFAULTSORT:{{#sub:{{PAGENAME}}|14}}}}" to "{{DEFAULTSORT:{{#sub:{{PAGENAME}}|7}}}}")
 
(7 intermediate revisions by 3 users not shown)
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 ====
 
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 ===
 
[[Ylands:Tile Availability - Server|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


Der Test.png


----
----
{{Ylands scripting navbox}}
{{Navbox/Ylands}}
{{DEFAULTSORT:{{#sub:{{PAGENAME}}|14}}}}
{{DEFAULTSORT:{{#sub:{{PAGENAME}}|7}}}}


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

Latest revision as of 15:24, 24 November 2023

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