Skip to content
Snippets Groups Projects
Unverified Commit 342226ea authored by Marshall Quander's avatar Marshall Quander Committed by GitHub
Browse files

Merge pull request #447 from mozilla/navmesh-whoops

 Fix buggy check in setPositionOnNavMesh
parents e70b3be7 f579976d
No related branches found
No related tags found
No related merge requests found
......@@ -18,8 +18,8 @@ AFRAME.registerComponent("character-controller", {
},
init: function() {
this.navGroup;
this.navNode;
this.navGroup = null;
this.navNode = null;
this.velocity = new THREE.Vector3(0, 0, 0);
this.accelerationInput = new THREE.Vector3(0, 0, 0);
this.pendingSnapRotationMatrix = new THREE.Matrix4();
......@@ -160,7 +160,7 @@ AFRAME.registerComponent("character-controller", {
setPositionOnNavMesh: function(startPosition, endPosition, object3D) {
const nav = this.el.sceneEl.systems.nav;
if (nav.navMesh) {
if (!this.navGroup) {
if (this.navGroup == null) {
this.navGroup = nav.getGroup(endPosition);
}
this.navNode = this.navNode || nav.getNode(endPosition, this.navGroup);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment