OMAR Posted March 29, 2016 Share Posted March 29, 2016 Hi everybody! So I've been working with Babylon's Animation system and I've been stuck with one issue lately. I'm trying to execute an animation but also trying to keep the current position as it is. I've been trying to get this to work here but failed miserably Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 29, 2016 Share Posted March 29, 2016 Can you elaborate more? http://www.babylonjs-playground.com/#BP9JD#4 Quote Link to comment Share on other sites More sharing options...
OMAR Posted March 30, 2016 Author Share Posted March 30, 2016 Hi @Deltakosh! Well, as you can see in PG if you press 'A' cube moves left or if you press 'D' it will move right. There is also another key: 'J' which is responsible for starting the "jumping" animation. If you move the box to the left or right and then press 'J' to start the animation the box suddenly transports itself to the center and then it starts the animation. Is it possible for animation to start from the cube's current position? For example if the box is at the left and when we press the 'J' it starts the "jump" animation from cube's current position (which is now at the left) and not from the center? Thanks Quote Link to comment Share on other sites More sharing options...
adam Posted March 30, 2016 Share Posted March 30, 2016 http://www.babylonjs-playground.com/#BP9JD#5 It will fail if you want to start the jump from another y position though. Quote Link to comment Share on other sites More sharing options...
adam Posted March 30, 2016 Share Posted March 30, 2016 Here: http://doc.babylonjs.com/tutorials/Animations it says: Use previous values and increment it: BABYLON.Animation.ANIMATIONLOOPMODE_RELATIVE I'm not sure why this doesn't work: http://www.babylonjs-playground.com/#BP9JD#6 Quote Link to comment Share on other sites More sharing options...
OMAR Posted March 30, 2016 Author Share Posted March 30, 2016 http://www.babylonjs-playground.com/#BP9JD#5 works perfect! I believe we have to create animation for every property we want to change? 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.