In my aframe project i want to controll the movement speed with the cardboard magnetic button => start/stop with cardboard button.
On my desktop and phone the click event works like i want but if i put my iphone in the cardboard the button "click" doesn't trigger. If i touch with my finger on the scene it works...
Does the cursor need some settings to have access to the cardboard button? I tested the button in the google cardboard app and it worked.
Here is a little example of what i have. You can see the click event in the console.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Click Test</title>
<script src="https://aframe.io/releases/0.7.1/aframe.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/aframe-extras.ocean.min.js"></script>
<script>
AFRAME.registerComponent("start-click", {
init: function() {
this.el.addEventListener("click", function() {
console.log("clicked in the scene")
});
}
});
</script>
</head>
<body>
<a-scene start-click>
<!-- sky + ocean -->
<a-sky radius="100" color="tomato" position="0 -6 0 "></a-sky>
<a-ocean id="ocean" width="200" depth="200" density="200" position="0 0 0"></a-ocean>
<!-- camera + cursor. -->
<a-camera id="camera" position="0 20 80 " fly wasd-controls-enabled="false">
<a-cursor fuse="false" id="cursor" color="black"></a-cursor>
</a-camera>
</a-scene>
<script>
document.querySelector("a-scene").enterVR();
</script>
</body>
</html>