Help runtime functions

Good morning, I wonder if the possibility of attaching scripts at runtime, for a plane, in the same way that would be done if it were added in ZapparStudio.

Hi There,

That is something that’s possible, please see a rough code example below:

makePointerDown(Plane0);

function makePointerDown(node : Z.Type.Object) {
    node.on("pointerdown",  () => {
       node.color([0, 0, 0, 1]); 
    });
}

Hope this helps :slight_smile:

Mark