Skip to main content

DyeHair

Represents a dynamic component specifically designed for the DyeHair.

TypeNameInterface Description
Functionsconstructor()

FunctionsgetProperty(type: DyeHairPropertyKey): any

Function: Gets a property value. The property key must match a supported DyeHairPropertyKey for the current dye mode.

Parameters

type: - Property name.

Returns Property value.

FunctionssetProperty(type: DyeHairPropertyKey, value: any): boolean

Function: Set property value.

Parameters

type: - Property name.

value: - Property value. The property key must match a supported DyeHairPropertyKey for the current dye mode, and the value type must match that property.

Returns Whether the property is set successfully.

Examples

constructor()

let obj = new APJS.DyeHair();

setProperty(type: DyeHairPropertyKey, value: any): boolean

const hairObject = scene.findSceneObject("Hair Color");
const dyeHair = hairObject.getComponent('DyeHair') as DyeHair;
// set color to red in Full mode
dyeHair.setProperty("Color", new Color(1, 0, 0, 0.7));
// set coverage to 0.5
dyeHair.setProperty("Coverage", 0.5);

Use Case

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