Jump to content
Search Community

The camera moves around the scene when scrolling THREE.JS GSAP SCROLLTRIGGER

LM3ALLEM test
Moderator Tag

Go to solution Solved by Cassie,

Recommended Posts

Hello, everyone! My problem is when I scroll camera works good but closer to the end its stopping moving smoothly. 
At the video I will show how its should work
I was inspired by this web-site :))
And as I said, I have some little problems..

This how is working right now:

    Sorry for music :))))

 

 

See the Pen MWVPwJB by lucas23456 (@lucas23456) on CodePen

Link to comment
Share on other sites

  • Solution

Sorry for the speedy responses yesterday! I was in a bit of a rush.

So, a timeline - you could add a scrollTrigger to the whole page and then tween the camera position like this?
(this is pseudo code, not for copy pasting)
 

let timeline = gsap.timeline({
 scrollTrigger: {
   start: 0,
   end: "max",
   scrub: true
  }
})

tl.to(camera.position, {
  x: 20,
})
.to(camera.position, {
  x: 0,
})
.to(camera.position, {
  x: 40,
})

 

You've posted this twice now though and it's still really hard to work out what you're after and what the issue is? It seems perfectly smooth to me, apart from a jump near the end which I assume is just due to a trigger position or tweening to the wrong value?

But there's not really an obvious GSAP specific error. 

  • Like 1
Link to comment
Share on other sites

5 hours ago, Cassie said:

Sorry for the speedy responses yesterday! I was in a bit of a rush.

So, a timeline - you could add a scrollTrigger to the whole page and then tween the camera position like this?
(this is pseudo code, not for copy pasting)
 

let timeline = gsap.timeline({
 scrollTrigger: {
   start: 0,
   end: "max",
   scrub: true
  }
})

tl.to(camera.position, {
  x: 20,
})
.to(camera.position, {
  x: 0,
})
.to(camera.position, {
  x: 40,
})

 

You've posted this twice now though and it's still really hard to work out what you're after and what the issue is? It seems perfectly smooth to me, apart from a jump near the end which I assume is just due to a trigger position or tweening to the wrong value?

But there's not really an obvious GSAP specific error. 

Thanks! 

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...