I have a cube that starts off static.
I then start rotating the cube using the
Change Speed and
At some point I would like to stop rotating the cube, but rather than it stop at some random rotation position, I would like it to rotate from it's current rotation back to 0. This is so the cube is front facing again and is essentially "reset" back to what it was when it was static.
I was trying to capture the current rotation value with
Allow First Value node, use that as the
Set Position in the
Smooth with Duration node and have
Set Target as the end rotation of 0.
And toggle between an "on" and "off" state with a simple if else statement. However I can't get it to animate back to 0. Does anyone have any ideas please? 🙏
Maybe I got caught in over complicated methods, and easier methods can be used, but joined are 3 comps.
1 - Version with
Smooth With Duration
The problem here is that smooth with duration you set a duration for the animation (360°), but if you you're at say 180, and you send back 0, it will take that same duration, but to go back from only 180 to 0, therefore it will be 2x slower for the spinning back animation.
2 - Version with
Count Within Range
Seems a way to go too. However here there is no "Curve" (cubic, quadratic, exponential) to the animation, but only linear.
3 - Is a way to add curves to the 2nd method, but with Martinu's custom node
Time Curvelink : here
But again, might be some way easier method I oversaw ;)
Smooth With Duration.vuo
Count Within Range.vuo
Count Within Range With Time Curve.vuo
Simpler: try replacing
Allow First Valuewith
Hold Valueand might also need to fire an event to the target.
Screen Shot 2021-12-12 at 6.49.10 PM.png
Thanks for the quick replies
Thanks for the quick replies as always :)
Bodysoulspirit the method
Count Within Rangeachieves what I need as I don't need easing in this instance. Nice to know about Magneson node set though, have installed. I just added a multiply node so that the rotation continues in the same direction (rather than rotating in the opposite) to get back to the starting point.
jersmi thanks! I learnt why it wasn't working before, I had tried Hold Value but didn't fire an event to
Set Target. This method is not quite there yet, since I need it to start rotating from 0 again (I want to be able to start and stop the rotation repeatedly) so when I toggle back to "rotate" mode it is not at 0. I'm also not sure how to have it go back to 0 but in the same rotation direction like with the adjustment I made to Body's file above.
Thanks again guys!
Screen Shot 2021-12-13 at 08.02.10.png
Great it helped ;)
Great it helped ;)
If you just want the animation to stop in the same spinning direction at the next 90° angle you can also do like in the joined comp, add 90° every time, but just don't add another 90° when you want it to stop ;)
This way you'd still got an easing curve if you wanted to.
Capture d’écran 2021-12-13 à 19.01.32.png
Count & Smooth.vuo
This is bang on
This is bang on Bodysoulspirit, love it!