Merge pull request #10093 from huffman/fix/tutorial-lighter-intersection

Fix the tutorial lighter using properties inside intersection results
This commit is contained in:
Ryan Huffman 2017-04-03 09:31:10 -07:00 committed by GitHub
commit 29b966ee04

View file

@ -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) {