cartman Posted June 19, 2016 Share Posted June 19, 2016 Hi guys, took a short hiatus on coding, now i'm back. I'm trying to move a cube through a curve. I built a simple "slow motion" function, where if the user clicks anywhere on the scene, the FPS of the cube's animation is slowed down. On the next click, the FPS returns to normal. (it's a toggling function). Somehow, it's causing a weird behavior. It's as if the 'slow-motion' cube's movement is entirely different from the regular cube movement. Take a look: http://www.babylonjs-playground.com/#14EGUT#22 (try clicking a few times, to see what I mean). My goal is to just slow down movement of the cube, and then increase it again back to normal. Any ideas on whats causing it, and how to fix this? Am I using the wrong functions? Quote Link to comment Share on other sites More sharing options...
cartman Posted June 20, 2016 Author Share Posted June 20, 2016 sorry, bumping this post, hopefully someone can figure this out. Been banging my head the past 24 hours on this Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 20, 2016 Share Posted June 20, 2016 This could work: http://www.babylonjs-playground.com/#14EGUT#26 Quote Link to comment Share on other sites More sharing options...
cartman Posted June 21, 2016 Author Share Posted June 21, 2016 @Deltakosh thanks for the ratio variable, but somehow it still acts weird. My observation I run the code. I wait till the cube gets halfway up the curve. I clicked once to slow down, the cube suddenly finds itself at the bottom again. Weird! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 21, 2016 Share Posted June 21, 2016 Actually this is kind of expected as the whole animation is based on a given speedRatio and a given FPS To solve your issue I would recommend recreating the animation 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.