andrew-m Posted August 10, 2014 Share Posted August 10, 2014 Hi, Complete newb to both Babylon and 3d in general, and I'm getting a mystery error at the end of an animation: "TypeError: e.scale is not a function" (at line 10 of babylon.1.13.js) Does anyone know if this is a common error, and what I've done to cause it? You can see the offending scene here: http://www.flowerchild.org.uk/3dDogfight/ Hit the "a" key to trigger the animation. The animation seems to work OK (some rotation and translation), but no further animations will trigger. I'm afraid I haven't stripped it down to a minimal example, and I'm out of time tonight, but if necessary I can do that in the next few days time permitting. Extra stuff:The error happened with babylon.1.12 too.I can only test in Firefox 30 (I'm on Ubuntu, and Chrome so far refuses to fathom my graphics drivers). I'm getting Finally - big thanks to Temechon, who's Toad attack tutorial I've been following, and apologies to Temechon for probably not reading the tutorial carefully enough! AlexB and Temechon 2 Quote Link to comment Share on other sites More sharing options...
AlexB Posted August 10, 2014 Share Posted August 10, 2014 I'm not a Babylon expert, but can you post your example using an un-minified version of the library? That may make the error more apparent when stepping through the code. Quote Link to comment Share on other sites More sharing options...
Temechon Posted August 11, 2014 Share Posted August 11, 2014 Hey, Thank you for reading my tutorial As AlexB asked, it would be easier to debug your code with a un-minified version of Babylonjs...However, I think you may have discovered a bug... A simple playground example to reproduce it : http://www.babylonjs.com/playground/#P5XVX (look at the console error). I will try to debug it later today. Cheers ! AlexB 1 Quote Link to comment Share on other sites More sharing options...
Temechon Posted August 11, 2014 Share Posted August 11, 2014 Ok, I found it It's a bug in babylon.js. The problem is here : Animation.prototype._interpolate : case Animation.ANIMATIONLOOPMODE_RELATIVE: quaternion = this.quaternionInterpolateFunction(startValue, endValue, gradient).add(offsetValue.scale(repeatCount)); break;}The problem occurs because the mode ANIMATIONLOOPMODE_RELATIVE is used on this animation, and because offsetValue equals 0 : scale is undefined on a float. offsetValue equlas 0 because of this : Animation.prototype.animate : var range = to - from; var ratio = delay * (this.framePerSecond * speedRatio) / 1000.0; if (ratio > range && !loop) { offsetValue = 0; returnValue = false; highLimitValue = this._keys[this._keys.length - 1].value; } else { //... }We will need for someone to fix it, as I don't have any clue about how to do it. As a workaround, you can use the mode ANIMATIONLOOPMODE_CYCLE in your animation. Cheers ! andrew-m 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 11, 2014 Share Posted August 11, 2014 Fixed:) thank you guys! Temechon 1 Quote Link to comment Share on other sites More sharing options...
andrew-m Posted August 12, 2014 Author Share Posted August 12, 2014 Thanks Guys, you all rock. I've got the latest beta 14 and the error's gone away, many thanks. Andrew. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.