Forum Discussion
Change state of object during animation path
Hey there!
Would there be a way of changing the state of an object while an animation is happening (motion path) and resume to its original state when it finishes?
Thank you!
- NedimCommunity Member
You can assign another motion path to an offscreen object and alter the object's state based on the timing of the offscreen object's motion path. Video demonstration attached. I'm not familiar with your interaction setup so I'm simply suggesting potential solutions based on my understanding at this point.
- MarianaEscrzagaCommunity Member
Thanks Nedim!
I'm trying that option but I might be triggering something wrong.
Let me share with you a sample of my motion path without any triggers or any additional elements, so you could possibly work on it. The idea is that the dog state changes to "run" when the motion path is happening. It should do it every time the motion path plays.
- NedimCommunity Member
Please find the attached .story file and take a look. It can be adjusted to increase or decrease the speed of the dog's movement. This can be controlled by changing the motion path of an offscreen rectangle, or both. The first slide displays the repetitive motion path, resembling a loop animation. The second slide is based on the relative start point, as in the original file.
- MarianaEscrzagaCommunity Member
Thank you so much! You're amazing :)
- JudyNolletSuper Hero
Just use two triggers:
- Change the state of the object when [whatever triggers the animation to start]
- Change the state of the object when the Animation completes
- MarianaEscrzagaCommunity Member
I forgot to mention it is a relative start point motion path that is triggered when the timeline starts, so this first step would not work
- NedimCommunity Member
You can utilize object interception events in conjunction with motion paths to transition the object state from one to another. Please refer to the attached video for a demonstration.
- MarianaEscrzagaCommunity Member
yes! I did try that option, but my object is too big and intersects even the smallest shape... could there be a solution around this?
- WaltHamiltonSuper Hero
Judy’s method would work. It doesn’t matter where the object is, you can change its state. It will not move without a trigger, and you can duplicate that trigger, and change “move” to “change state”. Just put the state change first. You can have a large list of triggers that fire as a result of the same action, even “when timeline starts”.