diff --git a/examples/entityScripts/lightController.js b/examples/entityScripts/lightController.js index e6e4998aef..31e07c4602 100644 --- a/examples/entityScripts/lightController.js +++ b/examples/entityScripts/lightController.js @@ -132,7 +132,7 @@ this.updateLightIDInUserData(); } else { var that = this; - Script.setTimeout(function() { that.maybeUpdateLightIDInUserData() }, 500); + Script.setTimeout(function() { that.maybeUpdateLightIDInUserData() }, 500); } } @@ -213,6 +213,10 @@ this.preload = function(entityID) { this.preOperation(entityID); }; + this.unload = function(){ + Entities.deleteEntity(this.lightID); + } + this.clickReleaseOnEntity = function(entityID, mouseEvent) { this.preOperation(entityID);