From 51ad631c540fab1dd0c357d123eca8c3a8fe9a4f Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 19 Feb 2015 13:14:46 -0800 Subject: [PATCH] dynamically grab animation URL as model URL from model --- examples/entityScripts/portal.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/entityScripts/portal.js b/examples/entityScripts/portal.js index e1f00b0afc..5dd7849c38 100644 --- a/examples/entityScripts/portal.js +++ b/examples/entityScripts/portal.js @@ -1,6 +1,7 @@ (function(){ var teleport; var portalDestination; + var animationURL; function playSound() { Audio.playSound(teleport, { volume: 0.40, localOnly: true }); @@ -11,6 +12,7 @@ var properties = Entities.getEntityProperties(entityID); portalDestination = properties.userData; + animationURL = properties.modelURL; print("The portal destination is " + portalDestination); } @@ -25,7 +27,7 @@ this.leaveEntity = function(entityID) { Entities.editEntity(entityID, { - animationURL: "http://hifi-public.s3.amazonaws.com/models/content/phonebooth.fbx", + animationURL: animationURL, animationSettings: '{ "frameIndex": 1, "running": false }' }); @@ -34,7 +36,7 @@ this.hoverEnterEntity = function(entityID) { Entities.editEntity(entityID, { - animationURL: "http://hifi-public.s3.amazonaws.com/models/content/phonebooth.fbx", + animationURL: animationURL, animationSettings: '{ "fps": 24, "firstFrame": 1, "lastFrame": 25, "frameIndex": 1, "running": true, "hold": true }' }); };