Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rive animation first time load failed #233

Open
ninibear030 opened this issue Feb 21, 2024 · 1 comment
Open

rive animation first time load failed #233

ninibear030 opened this issue Feb 21, 2024 · 1 comment

Comments

@ninibear030
Copy link

ninibear030 commented Feb 21, 2024

Hi guys, i am using next 13 with "@rive-app/react-canvas": "^4.8.1"
and this is my code

  const { RiveComponent, rive } = useRive({
    src: "xxxx.riv",
    stateMachines: STATE_MACHINE_NAME,
    artboard: "xxxx",
    autoplay: true,
    layout: new Layout({ fit: Fit.Contain }),
  }); 

sometimes the animation cant autoplay properly, (it looks broken like how it look in rive app before start the animation)
its like 25% chance this will happened and i cant find a way to detect it.

i tried below it also doesnt work

autoplay: false
useEffect(()=>{ if(rive) rive.play()},[])
or
useEffect(()=>{ if(rive) rive.play()},[rive])


@ninibear030 ninibear030 changed the title animation first time load rive animation first time load failed Feb 21, 2024
@ninibear030
Copy link
Author

plss help ;-;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant