Trail

A Trail is a node that creates a trail behind the Entity.

Function Description
globalDepth()

Returns the depth of the Trail in a 2D World.

setColor(r, g, b, a)

Sets the color of the trail.

setGlobalDepth(value)

Set the depth of the Trail in a 2D World.


globalDepth()

Returns the global depth of the Trail node. Depth decides which object is on top in a 2D World. A higher value will be above a lower number in the Scene.

Returns

number – The global depth of the Trail

↑ Back to top


setColor(r, g, b, a)

Sets the color of the trail.

Parameters

number red – the red component of the new color
number green – the green component of the new color
number blue – the blue component of the new color
number alpha – (Optional) the opacity component of the new color, max 255

let trail = this.entity().component("Trail");
trail.setColor(193, 66, 66); // set the trail to be red

↑ Back to top


setGlobalDepth(value)

Sets the global depth of the Animation node. Depth decides which object is on top in a 2D World. A higher value will be above a lower number in the Scene.

Parameters

number value – The global depth of the Animation

↑ Back to top

Did you find this page useful?

Please give it a rating:

Please provide some feedback!

This is very helpful to us.

Tell us how we can improve this post?