- Home /
iTween XYZ coordinates different than model transforms?
I have a model at position: -2.130466, -0.9984617, 1.754745
if I change z to: 1.444349....the object moves only slightly.
But if i put this into iTween MoveTo...it moves a great deal further (not sure where it ended up)
Why? iTween must base the Z location on some other position?
Example of my iTween code:
iTween.MoveTo(GameObject.Find("nameofobject"),iTween.Hash("x", -2.130466, "y", -0.9984617, "z", 1.444349, "time", 15));
if the parent object is scaled, changing position in the inspector can behave in unintuitive ways.
Answer by swynn · Apr 09, 2013 at 02:59 PM
It has a parent object, that was made by another artist.
You put me on the right path....I added "islocal" and everything is working fine now. Thanks!
New line is: iTween.MoveTo(GameObject.Find("nameofobject"),iTween.Hash("z", 1.440323, "islocal", true, "time", 5));
Answer by swynn · Apr 09, 2013 at 08:09 PM
iTween inherits information from parent by default. Adding "islocal" fixed the problem
My new line looks like this:
iTween.MoveTo(GameObject.Find("nameofobject"),iTween.Hash("z", 1.440323, "islocal", true, "time", 5));
Your answer
Follow this Question
Related Questions
How to make your script wait until function finishes 6 Answers
iTween not relative to parent 0 Answers
How to set iTweenpath dynamically 1 Answer
Method not working correctly in Unity 5 0 Answers
how to use a speed of controlled at any time in "moveto" 0 Answers