Skip to main content

PolylineCollider2D

A collider that generates a polyline shape for physics and rendering.

TypeNameInterface Description
VariablespixelPerUnit: number

Function: Set or Get the pixel per unit scale for the polyline collider. * Note: Setting this property will trigger a regeneration of the collider geometry.

Variablespositions: Array<Vector2f>

Function: Set or Get the center positions of points in the polyline collider. * Note: Setting this property will trigger a regeneration of the collider geometry.

Variableswidth: number

Function: Set or Get the width of the polyline collider. * Note: Setting this property will trigger a regeneration of the collider geometry.

Functionsconstructor()

FunctionsgetRenderMesh(): Mesh | null

Function: Get the visual mesh. If the polyline shape is changed, it updates. to ensure you get the valid state.

Examples

constructor()

let obj = new APJS.PolylineCollider2D();

Use Case

@component()
export class NewBehaviourScript extends APJS.BasicScriptComponent {
onStart() {
// TODO: instantiate / use PolylineCollider2D here
}
onUpdate(deltaTime: number) {
}
}
Copyright © 2026 TikTok. All rights reserved.
About TikTokHelp CenterCareersContactLegalTerms of ServicePrivacy PolicyCookies