johnatm / itween

Automatically exported from code.google.com/p/itween
1 stars 2 forks source link

islocal and orienttopath don't work together as expected #106

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Create a 5 point iTweenPath (a sin wave starting at 0,0,0 going towards +z, 
exact coods at end of issue)
2. Create and empty game object (parGO), set SRT to 0
3. Create a cube under parGO set SRT to 0
4. Put iTween MoveTo script on cube with orienttopath as true and islocal to 
false, everything works as expected (script provided at end of issue)
5. Now set posY of parGO to 20 and set islocal to true
6. Hit Pause then Play, problems highlighted below

What is the expected output? What do you see instead?

After #6, I would expect the cube to snap to 20 in Y. Instead, It snaps to 40, 
this is the first bug.
Hit Play now.
The cube is pointed straight down towards the path in world space. I would 
expect the cube to look along the path as if the path had been translated in y 
by 20. This is the second bug.

What version of the product are you using? On what operating system?

2.0.45 on Win 7 x64

Please provide any additional information below.

I read another issue where something similar was discussed and you asked 
whether it would make sense investigating this since paths are defined in world 
space. While this is true, islocal works almost as expected (besides snapping 
to the wrong starting point)

iTweenPath:
1. 0,0,0
2. 0,10,10
3. 0,0,20
4. 0,10,30
5. 0,0,40

Script for cube (you'll need to set the path suitable to your test case):
iTween.MoveTo(gameObject,{"path":iTweenPath.GetPath(path.name),
                "speed":20,
                "looptype":"loop",
                "looktime":0.1,
                "islocal":true,
                "orienttopath":true,
                "lookahead":0.001,
                "easeType":"easeInOutSine"});

Original issue reported on code.google.com by sajjad.a...@gmail.com on 4 Jun 2012 at 9:59