Layers in State Machine conflict
Hello everyone. I have a draggable slider with a Joystick, that works in one layer, and then another layer where I am using Number Input and different numerical value Listeners with AnyState to make animated presets for the slider. The draggable slider works initially, but when i select one of the presets (the dots) it animates into correct position and then the draggable slider no longer works.
Also noticed that when one of the presets is selected initially it doesnt follow the bezier curves, it just snaps into position. But afterwards the animation works correctly.
I'm sure there is a solution for all this, but I cant find any info online on how to do this specific set up.
I see. The problem is that you are using the same element (hitboxes) on both layers. Rive layers blend together, and they do from right to left. If you use the same element or property on both layers, the right layer blends on top. In the slider, You can see when the state machine starts, the left layer controls the element Hitbox , but on the right, none of the states are working. Once you use a pressset, one of the states of the right layer is activated, and when this happens, the Hitbox of the left layer stops working. That is why dragging does not work anymore. One way to fix this is to reset the hitbox element of the right layer every time you click on the slider. You can do this by creating a state with nothing in the right layer and using an event that every time you click and drag, changes the input height to a different value, for example 60, to go to this new state, and so there is no conflict with the hitbox. Check this example.
Hi! Interesting, never would have thought of this. I’m trying to reverse engineer what you did. Didn’t know you could target an art board as well. Thank you for this solution!