jayakannan Posted September 14, 2020 Share Posted September 14, 2020 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 More sharing options...
mikel Posted September 14, 2020 Share Posted September 14, 2020 Hey @jayakannan, Welcome to the GreenSock Forum. I am not sure what exactly you want to achieve. You could use timeScale to control the timing. Please note ease: 'none' (default is 'power1.out') to ensure a steady speed. See the Pen MWyVELQ by mikeK (@mikeK) on CodePen Happy speeding ... Mikel 3 Link to comment Share on other sites More sharing options...
jayakannan Posted September 14, 2020 Author Share Posted September 14, 2020 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 More sharing options...
mikel Posted September 14, 2020 Share Posted September 14, 2020 Hey @jayakannan, Please provide a minimal demo in CodePen or JSFiddle or something so that we can see things in context. We'd be happy to help, but it's tough without any demo. 2 Link to comment Share on other sites More sharing options...
akapowl Posted September 14, 2020 Share Posted September 14, 2020 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. 3 Link to comment Share on other sites More sharing options...
jayakannan Posted September 15, 2020 Author Share Posted September 15, 2020 Thanks for your reply @akapowl and @mikel . The duration which is mention in above reply @akapowl is working as per my need. Thank you so much 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now