I’m having trouble getting iTweenPath to work correctly. I’m attempting to write the tween in Java, and I went by an example posted by a user on the iTweenPage.
iTween.MoveTo(gameObject, {"path": "Circle Path", "time":5});
When I run the java this way, I get the error: “Cannot cast from source type to destination type.”
In this project, I already have regular iTweens working fine, with the iTween.cs file in the Assets/Plugins. However, when I installed the iTween unity package, it placed everything in a folder called Pixelplacement. The structure is as follows… if I can illustrate this clearly.
Pixelplacement (folder)
→ Editor (Folder)
→ iTweenPathEditor.cs
→ iTweenPath.cs
I read in a few of the posts that iTweenPath.cs should be in the plugins folder. Diagnosing this is a bit difficult, as every time I move the iTween files, my path turns to an empty behavior and I have to remake it, but I tried a few different combinations.
Moving iTweenPath.cs into plugins folder, leaving all other itween files where they are:
- Same error, “Cannot cast from source type to destination type.” Throws when the tween is called.
Moving iTweenPath.cs and Editor into the plugins folder.
- Same error, “Cannot cast from source type to destination type.” Throws when the tween is called.
Moving entire iTweenPath folder into plugins folder.
- Instance of iTweenPathEditor couldn’t be created. The script class needs to derive from ScriptableObject and be placed in the Assets/Editor folder. Error occurs as soon as I move the folder.
Does this mean that there’s a problem with the way I’m doing the itween, or is there still some odd combination of file placements I haven’t tried yet?