I am building a website using A-Frame and struggling to create a button that will reset the position of a ball with the ID "test" to 0 8 0. I have attempted to use the setAttribute script, but it is not working as expected. Below is the current JavaScript code that I am tinkering with:
AFRAME.registerComponent('ballreset', {
events: {
click: function(evt)
{
document.getElementById('test').setAttribute('position', {x:0, y:8, z:0});
}
}
});
Edit: I spotted a typo in the code, but unfortunately, it did not solve the issue.