Aframe 未能执行';setAttribute';论元素

Aframe 未能执行';setAttribute';论元素,aframe,getelementbyid,setattribute,aabb,Aframe,Getelementbyid,Setattribute,Aabb,当试图使用Kevin Ngo的aabb碰撞器组件将不可见实体设置为可见时,我使用A-frame VR v0.9.2“未捕获的DomeException:未能在元素上执行'setAttribute'时遇到此错误:0不是有效的属性名称。” <!DOCTYPE html> <html> <head> <script src=".../aframe-v0.9.2.min.js"></script> <script

当试图使用Kevin Ngo的aabb碰撞器组件将不可见实体设置为可见时,我使用A-frame VR v0.9.2“未捕获的DomeException:未能在元素上执行'setAttribute'时遇到此错误:0不是有效的属性名称。”

  <!DOCTYPE html>
<html>
  <head>
    <script src=".../aframe-v0.9.2.min.js"></script>
    <script src=".../aframe-extras.min.js"></script>
    <script src=".../aframe-event-set-component.js"></script>
    <script src="...aframe-aabb-collider-component.min.js"></script>
  </head>
  <body>
    <a-scene>
       <a-assets>
        <a-asset-item
          id="modelo"
          response-type="arraybuffer"
          src=".../model.glb">
        </a-asset-item>
      </a-assets>
      <a-entity
    id="3Dmodelo"
        gltf-model="#modelo"
        scale="1  1  1"
        position="-16.7 0 -7.8"
        visible="false">
      </a-entity>
       <a-entity
        id="rig"
        position="-5.481 -0.15 13"
        rotation="0 0 0"
        movement-controls="speed: 0.08"  
        aabb-collider="objects: a-box">
         <a-entity 
          camera
      geometry="primitive: box"
          position="0 1.6 0"
          look-controls="pointerLockEnabled: false">
     </a-entity>
    </a-entity>
      <a-box id="testeColisao" color="red" position="-5 1 10" event-set__hitstart="modeloVisivel()"></a-box>
    </a-scene>
    <script type="text/javascript">
        function modeloVisivel(){
        document.getElementById('3Dmodelo').setAttribute('visible','true')
        }
    </script>
  </body>
  </html>

函数modeloVisivel(){
document.getElementById('3Dmodelo').setAttribute('visible','true'))
}
有谁能帮我解决这个问题吗。如果有人知道一个更好的方案,请分享

谢谢。

将事件集\uuu hitstart属性更改为

event-set__hitstart=“_target:#blackSofa;可见:false”

下面是事件集组件的文档


根据它,您不能设置函数名

请提供一个要复制的示例链接。小故障是一个不错的选择。还要确保您使用的是最新的A-Frame版本:1.0.3Hi Diego,谢谢您的回复。很抱歉延迟了响应,您可以看看这里的示例,我在这个示例中使用的是框架1.0.3,但仍然是相同的问题。谢谢