Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Chinmay Tiwari

Scroll Trigger: Invalid Property x set to 3.57 Missing plugin? gsap.registerPlugin()

Recommended Posts

I am facing "Invalid Property x set to 3.57 Missing plugin? gsap.registerPlugin()" and "Invalid property section set to 0 Missing plugin? gsap.registerPlugin()" in the console. I came much further in the project but now I am facing this issue. Please Help!! 
 
import {gsap} from "gsap"
import {ScrollTrigger} from 'gsap/ScrollTrigger'
gsap.registerPlugin(ScrollTrigger)
 
 
const setupAnimation = ( ) =>{
    camera.position.x = 25.7;
    ScrollTrigger.matchMedia( {"(prefers-reduced-motion: no-preference)":desktopAnimation})
}
const desktopAnimation = ()=>{
    let section = 0
    const tl = new gsap.timeline({
        default : {
            duration: 1,
            ease: "power2.inOut"
        },
        scrollTrigger: {
            trigger: ".page",
            start :  "top top",
            end: "bottom bottom",
            scrub: 0.1,
            markers: true
        }
    })
    console.log("ScrollTrigger", ScrollTrigger)
   
    tl.to(  camera.position.x,{
        x: 3.57,
        section
    })
}

 

Link to comment
Share on other sites

Welcome to the forums @Chinmay Tiwari

 

To animate the x position, the target should just be camera.position, and section probably isn't a property of the camera position.

 

tl.to(  camera.position,{
        x: 3.57,
        // section
    })

 

  • Like 3
Link to comment
Share on other sites

@OSUblake You saved my life, literally I have spent around 2 hours fixing it and failed. And you did it in a few seconds.  God and Gsap Bless you.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×