Hi there, I am trying to create something like we can move a plane with our face. I know I can create a movement from position (Start) to a position (End) inside Transition patch normally. But this time I want to try something where we can pause (Stop) in the middle of the progress after initial head turn (left or right), then continue the animation after we turn left or right again.
Previously from this tutorial from youtube, we only allow to have like ‘continuously’ move the plane from point A to B. You can watch the tutorial here (Timestamp, 11:56):
This is my approach of doing that in patch editor:
But I got an issue where when I turn my head to left ➜ pause ➜ right ➜ pause ➜ right again the I can see the issue that the plane position is started from wrong position.
Here’s the project file, easier for you guys to test and see:
plane-free-move.arprojpkg (24.9 KB)
The issue is that you need to store the start value after you pause, then feed that into the start value of the animations. You can do this with a delay value patch. It takes some getting used to, but generally it works in the same way as delay frame. Here’s an article on it that should give you what you need.
Yes, that make sense! I need to take some times to understand on how the Delay Value works.
But in this case, do I need to use the Store Value patch assets from AR Library by Keetapol Boonprachak?
Because I saw in the official documentation mention about this patch here
Yeah exactly - that’s what you would need to build to store the value. The pulse should be the same one you use to pause the animation
Nice! I think based on my theory, it should work but I don’t know why the value of A (-0.51) and B (-0.3) is different. From my understanding, both of the value should be the same right?
Here’s a closer look to the value (in case you can’t see it)
Do you have any idea?
I think the animation patches are complicating things too much. Here is a way to do it without delay value or animation patches. You get the current position of the plane and add/subtract to it based on the left/right turn states. If no gesture is detected, then it uses a multiplier of zero to cancel the movement.
I added some position clamping based on screen size - here’s the project package.
plane-free-move-simple.arprojpkg (37.5 KB)
Wow it’s working! Thanks Josh, i’ll study your project and see how do you execute the animation. The approach is really cool, thanks again man.
Hi again Josh, just curious on how can I apply duration on the animation using your way above? In case I need to make the animation run slower or faster without touching the multiply value?
Because just now, I just play around to do some kind of ‘steppy’ animation to it and I realized that the ‘step’ is already there but there’s no duration input that I can apply to the animation (since we are not using Animation patch).
You can change the speed by changing this multiplication value.
Ah I found the workaround for the ‘steppy’ animation, I just add delay to the ‘add to current position’ patch and add if Else patch before connect to the Clamp patch to determine whether we want execute the delay or not by checking the head turn.