- Home /
iTween MoveTo doesn't move. [C#]
Hey It worked perfectly this morning, but now the float thingy doesn't work (the rest works fine) Does anyone know why this is happening?
if (transform.position.x >= 5.5)
{
iTween.MoveTo(gameObject, iTween.Hash(new Vector3(7.87f, 0.0f, -3.2f), 3.0f, "onComplete", "setPosAndSpeed", "onCompleteTarget", gameObject));
}
(It is located inside update)
Comment
Best Answer
Answer by appearance · Feb 07, 2013 at 01:30 PM
Missing "position" key in iTween.Hash(). Change your code to this:
if (transform.position.x >= 5.5f) {
iTween.MoveTo (gameObject, iTween.Hash ("position", new Vector3 (7.87f, 0.0f, -3.2f), "time", 3.0f, "oncomplete", "setPosAndSpeed", "oncompletetarget", gameObject));
}
Note: key names in iTween.Hash are in small letters.
Your answer
Follow this Question
Related Questions
Using iTween to move a gameobject from node to node 1 Answer
iTween MoveTo 4 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
iTween input with spring 1 Answer