Jump to content
Search Community

Unsuccesfull Tween, can't find gsap.to()

riccbarelli test
Moderator Tag

Go to solution Solved by Sam Tremblay,

Recommended Posts

Hello everybody,

I hope this topic is new, as I've checked multiple time and didn't find it covered.


In the link there's the code with which I have the problem. The problem is that when I try to use the function gsap.core.Tween.to(), giving it the control of the camera's position, the transition brings the camera to different locations to the ones I desire (which I tried with camera.position.set).

The first doubt is the import I made, because I can't find the function gsap.to() that everybody here seems to use. But I can also see that when the OrbitControls are declared and used, the function gsap.core.Tween.to() seems to position the camera correctly, but doesn't do the same for the target. I know it's probably some rookie mistake, but I would be grateful if someone could help. Thanks for the help


Link to comment
Share on other sites

Welcome to the forums, @riccbarelli


You definitely shouldn't be using gsap.core.Tween.to() - that's not really a thing and I wonder what made you think to even try something like that. If you want to tween something, just do gsap.to(...)


It looks like you're importing gsap properly...but then you're ALSO importing gsap again from "gsap/gsap-core.js" and naming it gsapCore. Why? You should just remove that altogether - you're not using it anyway. 


You've got hundreds of THREE.js warnings in the console. Sorry, I'm not familiar with THREE.js and we really try to keep these forums focused on GSAP-specific questions. 


The rest of your questions I didn't really understand.


If you've got anything related to GSAP you'd like to know, we would be happy to help with those. It's always best to provide a minimal demo, like in CodePen, CodeSandbox, or Stackblitz. When you just provide your whole project's Github repo, it's asking a LOT for people here to dig through all your code. When you take the time to provide a very clear CodePen/CodeSandbox/Stackblitz, you'll SIGNIFICANTLY increase your chances of getting a solid answer because it's far, far easier to troubleshoot/diagnose directly in the browser. 


Here's a starter CodePen that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo

See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen


If you're using something like React/Next/Vue/Nuxt or some other framework, you may find StackBlitz easier to use. We have a series of collections with different templates for you to get started on these different frameworks: React/Next/Vue/Nuxt.


Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. 

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