- Home /
Struggling with iTween moveTo example code
Hi all,
Bit embarrassing this one. I want to start using iTween but I can't even get the example code (copied from the PixelPlacement website) to work. Unity makes a number of complaints: (10,42)...Expression denotes a 'type', where a 'variable', 'value' or 'method group' was expected. I've removed 'Vector3' to leave just the variable but then I get... (10,44)... Unexpected symbol ',', expecting ')' That places the expected ')' in the middle of the Vector3 variable and Unity complains again (with good reason). What am I missing here?
using UnityEngine;
using System.Collections;
public class Tester : MonoBehaviour
{
// Use this for initialization
void Start()
{
iTween.MoveTo(gameObject,(2,0,0),2);
}
// Update is called once per frame
void Update () {
}
}
Answer by robertbu · Feb 02, 2014 at 05:56 AM
For c#, line 10 should be:
iTween.MoveTo(gameObject,new Vector3(2,0,0),2);
Of course! Works perfectly now, thank you. Once again you've saved me. =) I hope one day to get to a point where I can help newcomers too. ;-) Thanks again,
Your answer
Follow this Question
Related Questions
Stacking iTween.MoveTo calls 1 Answer
itween moveto not working 1 Answer
iTween moveby constrained by rigidbody constraints in Unity 5 2 Answers
iTweens MoveTo and "path" property 7 Answers
iTween MoveTo with LookAt 1 Answer