iTween issue

Hi,

I got error on the console about this line of code and don’t understand how to solve it, anyone can help please ?

iTween.ScaleTo(tailleDistance,iTween.Hash(“x”,15,“y”,15,“z”,15,“time”,1.6,“easetype”,iTween.EaseType.easeInOutCubic));

Regards,

What’s the error?

Error : Unknown identifier:‘iTween’.
I use Unity 3 on a Macbook Pro and ITween version 2.0.20 and previously used iTween 1.0.14 javascript version.
I placed the ITween script in a “Plugins” folder as mentioned. Look strange and I don’t understand …

Not sure can you show me the code you are trying to use to access iTween?

Here is the code.
I use it to display a graph below a ball. When clicking the ball, the graph appear and disappear with 2 different sound.
The cosinus is used to have a small and continue change in size.

Regards,


var sonIn : AudioClip;
var sonOut : AudioClip;
var graph : boolean;
var tailleDistance : GameObject;
var rotationAmount : float = -2.5;
var rotCos : float = 0;

function Start(){
tailleDistance.renderer.enabled=false;
tailleDistance.transform.localScale=Vector3(0,0,0);
graph = false;
}

function Update(){
rotCos += 0.1;
var amplitude : float = 15 + 0.15 * Mathf.Cos(rotCos);
tailleDistance.transform.localScale=Vector3(amplitude,0,amplitude);
tailleDistance.transform.Rotate(Vector3(0, rotationAmount*Time.deltaTime, 0));
tailleDistance.transform.position.y = 0.1;
}

function OnMouseUp () {
if(graph==false)
{
audio.PlayOneShot(sonIn);
iTween.ScaleTo(tailleDistance, iTween.Hash(“x”,15,“y”,15,“z”,15,“time”,1.6,“easetype”,iTween.EaseType.easeInOutCubic));
tailleDistance.renderer.enabled=true;
graph=true;
}
else
{
audio.PlayOneShot(sonOut);
iTween.ScaleTo(tailleDistance, iTween.Hash(“x”,0,“y”,0,“z”,0,“time”,0.6,“easetype”,iTween.EaseType.easeInOutCubic));
yield WaitForSeconds (0.35);
tailleDistance.renderer.enabled=false;
graph=false;
}
}

@script RequireComponent(AudioSource)


Hi Pixelplacement1,

Have you the time to watch the code posted ?

Regards,

Weird. I don’t understand why it can’t find iTween.

Have you attempted a new project, adding the “Plugin” folder and trying to access iTween then? This isn’t a problem that iTween is causing, I think it just might be a cache issue with your project.

Good luck.

I am having the same issue. I had no problems with iTween.js (v1.0x) with a previous unity iphone project. Now I’ve downloaded iTween.cs (the latest - v2.x) and I’m getting the same issue. I have it in /Assets/Plugins as well.

Can you please send me a project so I can take a look at what’s going on? Thanks!

FIRST @ Antidote or other people who have the same problem…
i had a similar problem since i did change to iTween V2… (Error : Unknown identifier:‘iTween’.)
in my case it was the compile-directory-order because of mixing different languages!
i did use cs-scripts (some plugins by other people) and js-scripts (my own stuff).
thats why i had to mind the compile-order!

Later, this was the reason, why iTween v2 wasnt found!
because its a cs-script, i had trouble again because of the compile-order!!!

SECOND @ pixel
Please can you help again…
I have the same Rotation-issues i did read in this forum, but in v2 (cs).
Its about the issue of RotatingBy or RotatingAdd.
In my case i have the same problems with the workaround of using RotationTo the correct calculated value.
In the inspector, the values are not for example 0, but 0,000012345… Round-issue!

My Question now is: do i use a wrong version of v2 (iam sure to use the link of your homepage) ??
because i often read its fixed in v2. but for me it worked much better in v1 (confused)
Is there a ‘#pragma strict’ version of v1 ??

Thousand Thanx for your iTween and for your help!

i could solve my problem with the RotationTo-issue i did write in my last post…
my object has got a rigidbody. if i click isKinematic=false, i have no issue!!!
so i have to toggle this before and after the rotation!

maybe this helps someone!

I don’t want to bother you since you are already doing a great job and you even share it for free.
I spent the whole evening reading forum 3ds about this issue, and I followed this instructions step by step. The script is in the “Plugin” folder and I try to call it from another script (I tried both c# and js)… it always give me

“Unknown identifier:'iTween”

I even tried to download the js version of iTween and I get a similar error.
All of this in a new Unity project after restarting my mac.
Now before giving up on using your library I decided to contact you here on the forums… I hope you or someone else can help me.

Unity version: 3.1 free

Piero

Can you get me the project so I can take a look?

Found the problem… iTween.cs must be in the “Plugins” folder, but not the other script which calls iTween. I’ve put them together :°|

I also noted that if you get the error “Unknown identifier” and move the scripts so that the code works (iTween.cs in the plugins folder and the calling script outside), the error doesn’t go away until a restart of Unity.

P.S.: thank you, my modest donation is coming soon anyway

Super glad you figured it out and thanks for the support!

@pixelplacement - First, I’d like to say that I love your plugins!

I’m also getting the “unknown identifier: iTween” error, but only for my .js scripts. My .cs script sees iTween with no problem. My previous app used all javascript, and iTween.cs worked flawlessly.

Here’s what I have already tried:

-Putting iTween.cs in the Assets/Plugins folder (as I’ve done in the past with no problems)
-Putting iTween.cs in the Standard Assets folder
-Manually setting iTween.cs to be the first script that gets compiled
-Installing the iTween editor via Unity asset store then running “Component/iTween/Prepare Visual Editor for Javascript Usage” (which did it’s thing with no errors)

All scripts that try to reference iTween are in a separate folder (not in the Plugins folder.) The only structural differences that I can see between my current problematic app and my other apps is that my current problematic app uses both .cs and .js files, and it also has Prime31’s iAD plugin in the Assets/Plugins folder. I’ve scoured the forums and Google, and now I’m out of ideas. Any help would be greatly appreciated. If you would like to see my project, just let me know the best way to get it to you. Thanks!

My problem turned out to be a compile order problem after all. I had a legacy folder called “iPhone Standard Assets”, and my script that references iTween lived in that folder. The scripts in that folder must have been getting compiled before the scripts in the Plugins folder. I moved my scripts out of “iPhone Standard Assets” and now it works. Still not sure why manually setting iTween.cs to compile first didn’t work, but at least I’m up and running now.

Rather than make a new iTween issue thread, I’m going to piggyback on this one.

This is actually an issue about your site, pixelplacement. On the Getting Started page, for the Javascript Hashtables section, you post an example as this:

iTween.MoveTo(gameObject,{"x":3,"time":4,"delay":1,"onupdate","myUpdateFunction","looptype","pingpong"});

…whereas the correct version should be this:

iTween.MoveTo(gameObject,{"x":3,"time":4,"delay":1,"onupdate":"myUpdateFunction","looptype":"pingpong"});

The difference is that a few of the commas have been replaced with colons. It didn’t work until I put the colons in (like the variables before).

Hi pixelplacement1,
I’m using unity 5.3 and iTween and I am getting an error saying unknown identifier : ‘iTween’. and I downloaded the cureent iT2ween version from unity. how can I fix this?

Wow, what a necro.
Please start your own thread as it is more likely to get answered.