[SOLVED] How to use tween .on('complete')

Back once again, I have an issue with my tween that I started to live with, but now I think it’s affecting other things. So in my turn base game I have my player tween to position, but then I need that to be that objects current position, using ‘SetLocalPosition’, for another function that updates both boards. So therefore I have to put the set position immediately afterwards which during play, makes a phantom object appear (most of the time) before the object moves to that position.

I assume I’m not using it correctly or I’m expecting a different outcome. What i’m expecting is it to run the commented line in the image once the tween finish, however ,it never does. Which is why I have to include it afterwards. Is there another/better way I can make this tween and set position afterwards?

Thanks in advance.

Ηι @Jason_Owens,

Your tween complete handler seems correct, if you uncomment that line it should work.

Though the last line in your code tries will override momentarily the tween that started, since it executes after the tween starts. I understand as you said that you did that on purpose, but I am not sure if that solves or produces your problem.

I can verify from my own code that the complete handlers fires as expected as soon as the tween finishes.


Yes, it was in my code, everything is working as it should. Thanks!

1 Like