Demigiant Forum
Unity Assets => DOTween & DOTween Pro => Topic started by: BitBash on August 15, 2015, 04:58:25 PM
-
Hi,
Quick question please. Looking through the documentation, I have not seen a method to Tween my own variable. For example:
public Vector3 customVector;
Is there something I am missing? Sorry if it's a stupid question, I really have looked.
Thanks!
-
Hi,
All DOTween shortcuts are made for known Unity variables, but they all take advantage of the generic tweening (http://dotween.demigiant.com/documentation.php#genericTo) way in the background. Said generic tweening way is what you want to use when tweening custom variables. In your case, here's an example:
// Tween customVector to 3,4,2 in 2 seconds
DOTween.To(()=> customVector, x=> customVector = x, new Vector3(3,4,2), 2);
Cheers,
Daniele
-
Amazing! Thanks Daniele.
-
You're welcome :)