Language

Click GUI Button and move the object to another set location

I need some help, I want to make my object move to another set xyz location when clicking the button I used transform.Translate but I don't know how the object will stop to the target location .Thanks a lot! here my script:

Or you could make a coroutine which is called when the button is pressed. I recommend reading the manual on this one before trying it out. It is a very useful feature to understand and master when building games: http://docs.unity3d.com/Manual/Coroutines.html