|
Currently I am trying to code a 'ping pong' effect. I would like the object to start at angle 0, than rotate to angle 90, than rotate back to 0, etc... What would be the easiest way to achieve this? Can I use Lerp? Any tips on an optimal setup would be great. Thanks!
(comments are locked)
|
|
Strangely enough, Mathf.PingPong is really good for 'ping pong' effects. ;) Oh my, how did I miss the Mathf.PingPong? Nice!
Jul 07 '11 at 07:22 PM
inewland
(comments are locked)
|
|
You could always do: You could also use quaternion.fromtorotation to get this effect. Finally instead of transform.eulerAngles.y = 90 or 0, you could use mathf. lerp from 90 to 0 or 0 to 90.
(comments are locked)
|
