2019-08-01 at 2:27 pm #17440
I have a model with 20 parts, I have a HTML button called “disassemble” that plays all animation clips so the model explodes outwards. It does this with a 0.5 sec offset of each part so they all play quickly rather than waiting for a previous clip to finish. It takes about 4 seconds to complete.
However, how can I make it play in reverse if the user presses “assemble” while the disassemble animation is still playing. I need to reverse the animation clips from their current frame for a smooth effect but having difficulty working out the puzzle to make this happen.
Any help would be much appreciated.2019-08-02 at 7:18 am #174462019-08-02 at 1:57 pm #17455
I will try and do this in JS instead then. Thanks for answering.2019-08-02 at 3:23 pm #17459
You can check the code generated by the play animation and pause/resume animation puzzles. It can be seen from visual_logic.js. A quick and dirty solution would be just add the reverse function to the resume animation puzzle code, so that it always changes the direction of animation once resumed.2019-08-02 at 5:06 pm #17461
Great, will look there first thanks.2019-08-03 at 11:19 am #17474
rev = true; if (rev) timeScale *= -1;
doesn’t reverse the frames as I assume the rev parameter is being passed in constantly as false from the puzzle so I can not override it later in the case statement. Adding in the entire timeScale code from PLAY check into the RESUME check also did not reverse the frames.
Thanks2019-08-05 at 7:16 am #174972019-08-05 at 9:44 am #17533
Fantastic, that worked perfectly. So I should have been modifying the action, I get that now. Thanks Yuri.2019-08-05 at 10:06 am #175372022-08-22 at 12:51 pm #55092fred7Customer
Is this now possible to do with puzzles? I need exactly the same. I got a structure which flips open and can be closed again with two HTML buttons. For the shape key object it works perfectly. Just need it for the animated object.
Please see the screenshot attached.
Attachments:You must be logged in to view attached files.2022-08-22 at 2:07 pm #55094kdvParticipant
get animation framepuzzle to set the last frame in the reversed animation or the first frame in the direct animation.
Puzzles and JS. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.2022-08-22 at 2:34 pm #55095fred7Customer
Many thanks! Tried that puzzle before, but did put it wrong.
- You must be logged in to reply to this topic.