This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useThree } from '@react-three/fiber' | |
import { gsap } from 'gsap' | |
import { useGSAP } from '@gsap/react' | |
export default function AnimateCamera() { | |
// Accessing camera from Three.js | |
const { camera } = useThree() | |
useGSAP(() => { // The new hook will take care of context and life cicle. | |
gsap.fromTo( // Creates the animation |