Jump to content


ScrollTrigger/Three.js - animate vector3 issue

Go to solution Solved by Chriz96,

Recommended Posts

I'm animating the camera in a Three.js scene. I'm able to animate the camera position using a timeline, but I also want to animate a vector3 called cameraTarget to control where the camira is looking. However if I log cameraTarget's values it shows that they actually update but in my scene the camera keeps the same cameraTarget view from the beginning, so basically it's not animating the cameraTarget position.


This is my camera and cameraTarget setup



This is my timeline



And here you can see if I log the cameraTarget values they change as they should, but I don't see the movement in my scene.


Link to comment
Share on other sites

  • Chriz96 changed the title to ScrollTrigger/Three.js - animate vector3 issue
  • Solution

Well I just had to update camera.lookAt(cameraTarget) by moving it inside my tick function

  • Like 1
Link to comment
Share on other sites

Hi @Chriz96 and welcome to the GreenSock forums!


Is great to hear that you were able to solve the issue and thanks for sharing how you did it 🥳


Happy Tweening!

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