18d ago

Is there a way to restart an animation from Nested artboard?

Hello!

If I key an animation (is playing) from a nested artboard, and it plays once, is there a way to restart again the same animation wihout stop/play the state machine?

I'm trying to create a "Retry" button for my mini game and was able to Reset everything beside the animations from nested artbords was invisible.

I tried to solve this by creating a new timeline where I play the animations backward to reset them, somehow it works only for the first animation but not the rest.

the_brave_knight_(audio).rev
6 MB
4 replies
18d ago
[deleted]
18d ago

Hi If the animation of the nested artboard is simple, you will not be able to restart it. In this case it is better to use the remap option. With the remap option the animation will restart every time you reset the state. Another option you have is for that animation to have a state machine to reset it, expose the input and use the input in the main artboard to reset it.

17d ago

Thank you for the reply . I will have to experiment more with remap/simple, as I'm still can't understand the difference between them. Also I remember that I couldn't use event from the main artboard to control an input from a nested artboard. Please if you know an file example or a video that might help me to learn this, I'll be greatfull.

I solved the issue with (the play backward technique "speed x-100"), it was working only for the first animation because its speed was keyed, and I forgot to key the speed for the rest -.-'

17d ago

This will depend on how you have the state machine configured and what you want to do, but in general, if you expose the input of the nested artboard, you can trigger it from the main artboard using the event. In this example, you can see that I have an animation of a ball controlled by an input and that the input is exposed. In the main artboard, I create an event, and, in this case, I trigger it from the timeline, but you could do it from a transition, state, or listener. Once the event is created, you only need to make Rive listen to it, and to do that, you use a listener using the main artboard as a target. Then, you just have to select the artboard nest input. This is a simple example, but it depends on what you want to do and how you have the state machine configured on the main artboard.

About simple animation and remap. The simple animation is ideal for animations or loops you do not need to restart. For example, the propeller can be a nested artboard with a simple animation in an airplane animation. It will constantly be spinning; while using the state machine, you control how the plane moves. The remap is good to use when you need to control the animation because it allows you to use time values. This allows you to stretch or shrink the animation. An example is making the animation speed up or starting the animation from a certain point in the timeline.

16d ago

Very clear! Thank you so much!!!