使用 A-Frame 1.0.4 + A-Frame Extras 导航网格和运动控制未捕获的类型错误 [英] Uncaught TypeError using A-Frame 1.0.4 + A-Frame Extras nav-mesh and movement-controls

查看:17
本文介绍了使用 A-Frame 1.0.4 + A-Frame Extras 导航网格和运动控制未捕获的类型错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用简单平面作为导航网格并设置我的装备的运动控制=constrainToNavMesh: true"时出现以下错误.

I'm getting the following error when using a simple plane as a nav-mesh and setting my rig's movement-controls="constrainToNavMesh: true".

aframe-extras.min.js:1 Uncaught TypeError: Cannot read property 'forEach' of undefined
    at m.getClosestNode (aframe-extras.min.js:1)
    at o.getNode (aframe-extras.min.js:1)
    at i.<anonymous> (aframe-extras.min.js:1)
    at HTMLElement.tick (a-scene.js:709)
    at HTMLElement.render (a-scene.js:759)
    at bind.js:12
    at f (three.js:24703)
    at e (three.js:15038)

<script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/donmccurdy/aframe-extras@v6.1.0/dist/aframe-extras.min.js"></script>
<script src="//cdn.rawgit.com/donmccurdy/aframe-physics-system/v4.0.1/dist/aframe-physics-system.min.js"></script>

<a-entity id="rig" position="0 0 0" movement-controls="constrainToNavMesh: true">
<a-entity id="camera" camera position="0 1.6 0"></a-entity>
</a-entity>

<a-entity geometry="primitive: plane; height: 350; width: 350;" position="0 0 0" rotation="-90 0 0" static-body nav-mesh>
</a-entity>

这是一个已知的错误吗?我首先认为存在冲突,但即使删除了所有其他包含,问题仍然存在.所有模型都可以正常加载,其他一切正常.

Is this a known bug? I first thought there was a conflict, but the problem persists even when all other includes are stripped out. All models load fine, and everything else is working.

仅当按箭头键开始移动时才会发生错误.有什么建议吗?

Error happens only when movement is started by pressing arrow keys. Any advice?

推荐答案

我的问题是导航网格太大.使用按比例缩小的相同导航网格有效.您可能需要缩小整个项目的规模,但这是我所知道的唯一解决方案.

Problem for me was that the nav mesh was too big. Using the same nav mesh scaled down worked. You might have to scale down your whole project, but that is the only solution I know of.

这篇关于使用 A-Frame 1.0.4 + A-Frame Extras 导航网格和运动控制未捕获的类型错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆