Hello, i have a project running in html5 canvas.
Since i cannot tell anything about the project itself, i try to make it easy to understand with other stuff.
Lets call the first object A
and the second object B
Object A gets moved by the users mouse (i handled that without TweenLite) and object B should stay to the same relative position as object A.
Object A can rotate, when it rotates object B rotates around object A to get the same relative position. This all works perfectly.
This code gets called around 150 times a second to try bring object B to the target position at A.
TweenLite.to(this, 0.5, {x: this.targetX, y: this.targetY, })
(decreasing duration in this code will look bad, so when i make it on 0.1 its lags not a lot behind but it looks bad)
Now the problem i have is that object B lags behind as long object A is moving. When object A stops, object B has no problem to reach the target position but since object A is constantly moving, object B wont reach object A.
I tried to make some picutres to make it understand it better:
Here you see object not moving - everything is good. Object B is in correct position
Now object A rotatet a bit around, object B followed. Also looks good ( think it also lags a bit behind, but since the rotation is not fast, its not noticable)
But now object A starts speeding up to a higher constant speed - object B trys to follow with the code that gets called 150 times per second, but it looks like that:
I hope i somehow made it understandable ?
So basically everything is working, rotation is looking good (nvm that small lag cause of the low rotation speed) but as soon it speeds up, object B got a distance which wont go any closer.
Thank you for any help!