Demigiant Forum
Unity Assets => DOTween & DOTween Pro => Topic started by: par on January 09, 2016, 06:27:34 PM
-
Is it possible to run a DOTween DOPath tween but have a callback that is... well called every time the tween hits one of the waypoints in it's array?
Thanks!
PAR
-
Hi,
Absolutely, check out the OnWaypointChange callback (http://dotween.demigiant.com/documentation.php?api=OnWaypointChange) ;)
Cheers,
Daniele
-
Well crap, how did I miss that? I apologize and thank you!
PAR
-
Um... quick question on DOPath though.... It seems as if its returning to the starting position. I was assuming that when the last waypoint was reached the tween would stop. Is this possible w/ DOPath? I didn't see a DoSpline type method...
PAR
-
Hmm... and is it possible to send the tween object itself (or any other parameter) into the OnWaypointChange() method like we do the normal callback lambdas?
Thanks!
PAR
-
Hi,
You can use a lambda too with OnWaypointChange, while accepting the int parameter:
// "x" in this case represents the int parameter
...OnWaypointChange(x=> AnotherMethod(x, myTween));
// ...
// Example method
void AnotherMethod(int waypointIndex, Tween myTween) {}
About the path returning to the start, that should totally not happen. Are you using the latest version of DOTween (1.1.135)?
Cheers,
Daniele