(function(){ var teleport; var portalDestination; function playSound() { Audio.playSound(teleport, { volume: 0.40, localOnly: true }); }; this.preload = function(entityID) { teleport = SoundCache.getSound('http://s3.amazonaws.com/hifi-public/birarda/teleport.raw'); } this.enterEntity = function(entityID) { print('Enter event'); var properties = Entities.getEntityProperties(entityID, ['href']); // in case the href has changed portalDestination = properties.href; print('enterEntity() .... The portal destination is ' + portalDestination); if (portalDestination.length > 0) { print('Teleporting to ' + portalDestination); Window.location = portalDestination; } }; this.leaveEntity = function(entityID) { playSound(); }; })