From 45726c33d819c20d021a4c6ce7bd4f2c90724cca Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Fri, 31 Mar 2017 15:46:23 -0700 Subject: [PATCH] Fix the tutorial lighter using properties inside intersection results Entity properties are no longer included in intersection results. --- tutorial/lighter/butaneLighter.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tutorial/lighter/butaneLighter.js b/tutorial/lighter/butaneLighter.js index 574c2be6c6..f37769f867 100644 --- a/tutorial/lighter/butaneLighter.js +++ b/tutorial/lighter/butaneLighter.js @@ -154,9 +154,12 @@ direction: Quat.inverse(Quat.getFront(flameProperties.rotation)) } var intersection = Entities.findRayIntersection(pickRay, true, [], [_this.entityID, _this.lighterParticleEntity]); - if (intersection.intersects && intersection.distance <= FLAME_LENGTH && intersection.properties.script !== '') { - Entities.callEntityMethod(intersection.properties.id, 'onLit', [_this.triggerValue]); - debugPrint('Light it up! found: ' + intersection.properties.id); + if (intersection.intersects && intersection.distance <= FLAME_LENGTH) { + var properties = Entities.getEntityProperties(intersection.entityID, 'script'); + if (properties.script !== '') { + Entities.callEntityMethod(intersection.entityID, 'onLit', [_this.triggerValue]); + debugPrint('Light it up! found: ' + intersection.entityID); + } } }, releaseEquip: function(entityID, args) {