Jump to content
Search Community

PraveenV21

Members
  • Posts

    1
  • Joined

  • Last visited

PraveenV21's Achievements

  1. Hello, I am a beginner to threejs and gsap, and in that matter generally speaking of web development I am pretty new. Here I'm trying to essentially after the "rocket" takes off from the platform, zoom in to make a cool effect, and then I want the rocket to move from the top back to the bottom so I can animate it as if it were starting below the screen again. Therefore, I tried the most logical solution which was to just use the onComplete() method after my animation for the rocket taking off ended and accordingly changing the position. However, what I noticed was not only for some reason were the x and z coordinates messed up in the following tween, but also as seen in the video. It would actually alter the original animation somehow, even though it shouldn't have? I have about no clue why this happens, and only happens when I scroll at a rapid pace. I've tried to fix this bug for the past 2 1/2 hours, and just decided to give up and go with a more simple solution. Which would be just to have another model which would be seperate from the one which took off from the platform and below the screen, so no issues would be found. I kinda neglect this solution because it would mean on subsequent tweens I would have to include more and more of the same models and decrease the performance overall. Idk, I might honestly suck at coding and any help or advice would be gladly appreciated. -- code of error -- timeline.to(ls.position, { z: 10, --> just moves the site inwards for the cool affect duration: 10, // onComplete: () =>{ // rocketModel.position.y = -100; // rocketModel.position.z = 0; // } --> commented out the code which caused this error. }) timeline.to(rm.position, --> moving it(idk why but the x and z were flipped for some reason with this oncomplete bug??) // { // y: -20, // // z: -40 // }) FYI -- I can try to include a codepen, but idk how feasible that will be since my project has so many dependencies. I'll make one if people are actually interested in helping fix this bug. But, if my second solution of j including more models isn't bad practice then I'll j keep it. gsap-issue.mp4
×
×
  • Create New...