Skip to main content

BasicScriptNode

APJS Script API reference for the BasicScriptNode class.

TypeNameInterface Description
Variablesscene: APJS.Scene

Function: The scene provided by the visual scripting runtime for this node execution context. This value comes from the graph runtime and is available when the node is executing. Use it inside execute() or other runtime-triggered node logic to find scene objects or query scene state.

Functionsexecute(): void

Function: Main execution entry for the node. The visual scripting system calls this method when the node is triggered. Override it in custom nodes to read inputs, update outputs, access this.scene, and perform node logic.

Examples

scene: APJS.Scene

@customNode()
export class FindNode extends BasicScriptNode {
execute(): void {
const target = this.scene.findSceneObject('Target');
if (target) {
console.log(target.name);
}
}
}

execute(): void

@customNode()
export class PrintNode extends BasicScriptNode {
execute(): void {
const target = this.scene.findSceneObject('Target');
if (target) {
console.log(target.name);
}
}
}

Use Case

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