GSAP and framer-motion-3d animations don't work
We've been building a VR game with @react-three/vr which is an absolute blast.
We have found some issues where GSAP and framer-motion-3d don't work.
That may be because they use requestAnimationFrame, but we're not sure.
Does anyone know why this doesn't work and can we help to fix this? :)
The problem is most certainly the rAF. When browser enters an immersive session it will (I don't remember if all of them do or the certain ones, like Oculus Browser) stop the rAF (in workers also) and you'll have to rely on session frame callback to do stuff. Animation frameworks and libs usually have a safehatch to trigger the update from the outside, that's were you need to dig. For instance here how it's done in @react-spring/three, https://github.com/pmndrs/react-spring/blob/master/targets/three/src/index.ts#L18
For a vr session you can use useFrame for r3f 8+ or useXREvent for older ones
@meesrutten does that ^ helps?