2

Working on a filter that changes things on tap of an object. Was working minutes earlier then got the following:

TypeError: TouchGestures.onTap is not a function. (In 'TouchGestures.onTap()', 'TouchGestures.onTap' is undefined) { "line": 47, "column": 0, "sourceURL": "script.js" }

I didn't edit the code while working on some small changes in spark. Here's the following events I'm mapping to touch gestures:

TouchGestures.onTap().subscribe(toggleParticles);
TouchGestures.onTap().subscribe(toggleParticleEnvironment);

Sounds like I'm not getting access to any methods for touch gestures. Is anybody experiencing this now or ever experience something like this with Spark?

Peter Lum
  • 143
  • 4
  • 13

1 Answers1

6

i just started having the same issue. super simple script, it was working one minute, then started throwing this error, but nothing changed

here's my code

const Diagnostics = require('Diagnostics');
const TouchGestures = require('TouchGestures');

TouchGestures.onTap().subscribe(function(gesture){
  const x = gesture.location.x;
  const y = gesture.location.y;

  Diagnostics.log(`tap: ${x}, ${y}`);
})

[EDIT]

Looks like you need to enable 'Tap Gestures' in the capabilities settings. Not sure why it worked momentarily, but when I enabled this it started working again project/edit properties/capabilites

legshampoo
  • 61
  • 5