rive-react-native icon indicating copy to clipboard operation
rive-react-native copied to clipboard

Animation is not smooth on first fire

Open Bayramito opened this issue 3 years ago • 2 comments

Description

I just installed the Rive to test it out on Android, it's working but not as expected.

So in Rive's Discord i found a dark mode switch project which is here Dark mode switch

My knowledge about Rive is quite limited so simply i wanted to create a dark switch with a onPress event.

so when I press for first time the switch is switching but not with animation, after second click its starting to work as expected.


 <TouchableOpacity
          onPress={() => {
            setIsDark(!isDark);
            riveRef.current.setInputState("State Machine 1", "isDark", isDark);
          }}
          autoplay={true}
          style={{width: 100, height: 50}}
        >
          <Text>FIRE</Text>
        </TouchableOpacity>
        <Rive
          ref={riveRef}
          resourceName="dark"
          style={{width: "100%", height: 40}}
          autoplay={false}
        />

https://user-images.githubusercontent.com/44513402/192143445-b4ec20f8-dc09-4878-8501-b5eca44d1af4.mov

Bayramito avatar Sep 25 '22 12:09 Bayramito

@Bayramito did you find a solution ?

perroudsky avatar Feb 07 '23 16:02 perroudsky

Probably related to the native iOS sdk: https://github.com/rive-app/rive-ios/issues/269 I indeed have no issue on Android, my first animation being not smooth only happens on iOS.

PierreCapo avatar Jan 05 '24 22:01 PierreCapo