itween path in javascript

Hello!
i have to move an object along an itween path. I need to code this inside a javascript script (the action will be performed when a GUI.Button is pressed). I don’t know how to code this in javascript, there are only c# examples. Can you help me?

You’ll need iTween.MoveTo, and it will look something like this:

var myPath = Transform[];

function OnGUI () {
  if (GUI.Button(Rect(10,10,100,50), "Click me!")) {
    iTween.MoveTo(gameObject,{"x":3,"time":4,"path":myPath});
  }
}

The first line (var myPath = Transform) is the list of objects that MoveTo will use to go along the path. You’ll need to define those yourself in the Inspector.