Jump to content
Search Community

How to control speed of gsap.to() function

jayakannan test
Moderator Tag

Recommended Posts

I am using gsap to change the position of camera in threejs .  I need to control the speed of gsap.to() . Below is my code for changing the position

 

gsap.to( camera.position, {
					duration: 1,
					y: 5,
					} );

Now I need to control the movement speed of it. How to do that. Thanks in advance.

Link to comment
Share on other sites

Hi @mikel , 

Thank you for your kind reply, I need to change the position of camera in threejs. For that I am using gsap.to() function.  It is working, but I felt that the speed is little much faster. So, to control that, I need help. From above answer I tested the timeScale within the gsap.to() function. But it shows an warning like, Invalid property timeScale set to 0.5 Missing plugin? gsap.registerPlugin().  How to achieve this.

Link to comment
Share on other sites

 

Hey @jayakannan

 

I really don't know, if I understand correctly, but if you simply just wanted to de- or increase the 'speed' of that single tween, it would help changing the duration on it.

 

A duration of 0.5 seconds would make your camera go to that 'y:5' in a shorter time period, thus faster - a duration of 2.0 would make it go there in a longer time period, thus slower.

 

 

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