Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: MKingery on February 17, 2014, 06:59:46 PM

Title: Best way to randomize a Tween animation?
Post by: MKingery on February 17, 2014, 06:59:46 PM
Hey all - artist here so be gentle.

Im looking to find out what (if any) options i have to tweak NGUI's built in tweens into allowing animation variations.

For example when i close a popup i want it to fall away which is easy enough - but adding a rotation tween that randomly picked between 30 and -30 degrees would be icing on the cake. Ideally the curve editor would play out as it does in the Particle System where i can specify a random between 2 constants or 2 curves.

Is this possible without coder intervention? assuming the answer is no - what would be the best ways for me to go about pitching this to code?

Thank you all - hope this is clear enough!
Title: Re: Best way to randomize a Tween animation?
Post by: ArenMook on February 18, 2014, 09:57:43 AM
Nope, anything that involves random behaviour has to be coded.
  1. Vector3 euler = new Vector3(0f, 0f, Random.Range(-30f, 30f));
  2. TweenRotation.Begin(targetObject, duration, Quaternion.Euler(euler));
Title: Re: Best way to randomize a Tween animation?
Post by: MKingery on February 18, 2014, 10:37:51 AM
understandable and thank you!