- Home /
Question by
Adriaan · Jan 22, 2010 at 01:34 PM ·
rotationgameobject
How to script a forever going swing?
Now that I have a configurable Joint and made sure my object would only rotate on the y angle, how can I use a simple script to let it swing back and forth eternally?
Comment
Best Answer
Answer by efge · Jan 22, 2010 at 02:12 PM
You could use the Animation Editor:
Create an Animation Clip animating Rotation.y only, set the WrapMode to Loop or PingPong and attach it to the GameObject.
http://unity3d.com/support/documentation/Components/AnimationEditorGuide.html