【发布时间】:2020-05-10 10:33:05
【问题描述】:
我正在尝试开发一个简单的 Instagram 过滤器,因此尝试在 Spark AR 中编写一个简单的 JS。 这是我的代码,基本上是从教程https://sparkar.facebook.com/ar-studio/learn/documentation/scripting/reactive复制过来的:
const Scene = require('Scene');
export const Diagnostics = require('Diagnostics');
const TouchGestures = require('TouchGestures');
// Subscribe to tap gestures
TouchGestures.onTap().subscribe(function (gesture) {
// Log a message to the console when a tap is detected
Diagnostics.log('tap gesture detected');
});
Spark AR 给我一个即时错误。消息是
Error:undefined is not a function
{
"line": 6,
"column": 0,
"sourceURL": "script.js"
}
我是否缺少任何库,或者除了 Spark AR 之外,我还需要安装任何东西吗?
我完全不知道出了什么问题。 :/
在此先感谢...
【问题讨论】:
标签: javascript spark-ar-studio