I’m currently trying to shoot little squares from one object (position) to another. To achieve this, I am using Three.js for the drawing/rendering together with GSAP for the animations. My current code to perform the animation looks as follows:
gsap.to(obj.position, {
duration: 1,
x: destinationObj.position.x,
y: destinationObj.position.y,
z: destinationObj.position.z,
})
It is possible that my destination object coordinates change during the animation. However, with my current code the object still shoots to the old coordinates, which doesn’t look nice. Is there a way to continuously update the destination coordinates during the animation such that my objects adjust their course when necessary?