Hi and welcome to the Community,
Do you know about The Playground? The PG (playground) let’s us share parts of code and assets to discuss and fix issues. I would highly recommend to take a bit of time setting-up a PG when in need for answers. You can use either JS or TS in the playground.
Fact is it’s very hard to determine a problem from a just a couple of screenshot and a few lines of code (out of context). IE: I have to admit I actually do not fully understand your code. Starting with cylinder.rotationQuartenion.y value divided by 180? I have no faen clue what this is supposed to do?
For one thing that’s sure is that somehow you need to ‘start the animation’. Or in other words ‘begin’. Either though ‘anim.start()’ or ‘scene.beginAnimation()’ depending on the type of animation/animationGroup. With one more to be added to this - being the ‘runtime’ animation.
Yes, well… that’s up to you. As per the above, there are two/three types of animations in BJS.
In general, two different approaches:
The animation that is triggered through a function to run (start/begin) and end (stop/pause) the animation. This animation type is described in this section of the doc. It’s got a number of variants incl. animationGroups. It can also come from an animation that’s created straight in BJS - or - it could be imported along with the model.
And then, there’s also The ‘runtime animation’. Runtime animation is made on an ‘onBeforeRender’ state. At ‘framerate’ (60 per default), the runtime animation is called before rendering the scene. On each frame rendered, you can change the value by incrementing it. You’re gonna need some ‘condition’/variable to stop or change the animation on runtime. And then eventually to clear the interval (clearInterval(myInterval); ) if you are using ‘interval’ and eventually to ‘unregister’ the runtime animation/function (scene.unregisterBeforeRender(myAnimFunction) if not needed anymore.
Runtime animation are explained in this section of the doc.
Again, welcome to our Community. Do not hesitate to reach out for help (but try have a look at how to set-up a playground). You will get much faster and more accurate feedback from us Meanwhile, have a great day
uh, you only needed the hint on the 1st screenshot…
Thanks for the answer, I found the problem: for some reason i have 2 different class for animation, but Idk where is non-Babylonjs class for animation from…
Fair enough. I must be a bit ‘dumb’ then Obviously, I’m no good ‘extrapolating’ from just a screenshot Anyway, I’m glad you find the answer to your issue and can now continue your journey with the framework You may also tick your answer/post as a solution (so that others won’t spend time looking at it … it will also increase your ‘reputation’… it’s always good to have users answering their own issue Sometimes you just need to express it to solve the problem … I’m a lot like that