iTween help needed

Hi

Im very new at scripting in Unity / iTween.
Im currently using Javascript and im trying to get this to work:

var LandingZone =  GameObject.Find("LandingZone");

function Start ()
{
iTween.MoveTo(GameObject, {"position": Vector3(LandingZone.transform.position.x, 0.5, LandingZone.transform.position.z), "time":10, "easetype": iTween.EaseType.linear});
}

I’m trying to move an instantiated object to the “LandingZone”
So far i can assign a script to the object, but can’t figure out how to get the object to move to the landing zone.

any help will be greatly appreciated.
thanks
Sam

var CatchSpeed = 50.0;

function Update ()

{

// Follows the target position like with a spring

  transform.position = Vector3.MoveTowards(transform.position, LandingZone.transform.position, Time.deltaTime * CatchSpeed);

}

You can change the CatchSpeed to change how quickly the object moves. I’m sorry if this doesn’t work exactly, having had no experience with iTween yet, but you should be able to manipulate this to your bidding.

hey thanks for the reply,

i couldn’t quite get your method working, but i did manage to fix it using iTween:

iTween.MoveTo(gameObject, {"position": Vector3(LandingZone.transform.position.x, 0.5, LandingZone.transform.position.z), "time":10, "easetype": iTween.EaseType.linear});

I think my major problem was not finding “LandingZone” correctly. i didn’t define it as a gameObject and that’s why it wasn’t working.

but thanks

Sam