I would like to toggle between pointer up and pointer down.
I would like to toggle and turn of and on a photo sphere image. Currently I need to touch and hold the plane to trigger the pointerdown but as soon as I stop touching it. It goes back to pointer up. I would like to toggle between both a click at a time and not have to hold it.
Thanks,
This is the code I have below.
var background1 = parent;
var PhotoSphere = symbol.nodes.PhotoSphere;
parent.on(“pointerdown”, parent_pointerdown);
parent.on(“pointerup”, parent_pointerup);
// Runs when pointerdown occurs on the parent node
// The argument e contains useful info about this event:
// https://docs.zap.works/studio/scripting/reference/object/events/pointerdown/
function parent_pointerdown(){
PhotoSphere.visible(true);
}
function parent_pointerup(){
PhotoSphere.visible(false);
}