Jump to content
Search Community

Change light intensity on scroll threejs

Guest
Moderator Tag

Go to solution Solved by akapowl,

Recommended Posts

Hello , i try to change light intensity on scroll with some fade using scroll trigger 

```

gsap.to(nightShadowLight.intensity, {
    intensity:0,
    scrollTrigger:
    {
        trigger: renderer.domElement,
        start: 'top top',
        end: '+=500%',
        pin: true,
        scrub: true
    },
    onUpdate: function () {
 
    },
})
```
 
Link to comment
Share on other sites

  • Solution

Hey @leenalfalah

 

It's always best to include a minimal demo because it can often be hard to tell what's wrong from just a codesnippet.

 

I would guess, that maybe you just need to remove the .intensity from your target selector ( nightShadowLight.intensity )

 

See the Pen bed39f19a1f1dffb71f4a42e9a628b7b by akapowl (@akapowl) on CodePen

  • Like 3
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.
×
×
  • Create New...