iTween help needed, some features work, some don't

Greetings all, i’m a Unity newb but a long time fan… I jumped in with specific project in mind and it’s going well. I needed a way to fade objects to a transparent states and I found iTween to fit the bill nicely… I’m having a mysterious issue though…

the Goal
I fiddled with iTween for many hours and finally got something working (which proves my Plugins folder is correct and everything is in a healthy path I suppose). I am making a “soundboard” using some high res animations I made http://LitStudios.com/unity/mpx_interactive.mov . I got the interactivity working alright. The user presses a a portion of the screen (or touch table in my case) and one of these anims comes up with audio. it loops until the user presses that anim again to turn it off.

the Problemo
i am trying to use iTween to both fade the alpha to 0 (transparent) and fade the audio to 0, then stop the movie texture and audio so it can be restarted again in a healthy way (a 1 or 2 second linear tween is my goal). I learned that the stop/start on the loop in unity is not great, i never really restart the sample from dead silence, it always plays back a bit of what was playing when i stopped it previously, hence my desire to fade to nothingness. ok, so I never got the Alpha tween working, though I got “MoveTo” doing something (as a test, though it didn’t move the whole object, just the audio gizmo, i know i’m missing something simple), and I now have volume ramping down to silence (though it never really “stops” because i cannot start the audio again, it remains silent or cannot be refired.

the Setup
I have a flat plate with a movie texture on it, along with the audio contained in the .mov file, and I created a js for each plane containing the following:

renderer.material.mainTexture.loop = true;	
renderer.material.mainTexture.Stop();
audio.Stop();
function Update () {
	if (Input.GetButtonDown ("Fire2")) {
		if (renderer.material.mainTexture.isPlaying) {
			renderer.material.mainTexture.Stop();
			audio.Stop();
			//iTween.AudioTo(gameObject,{"volume":0,"time":1,"onComplete":"audioStopped"}); //this tweens
			//iTween.FadeTo(gameObject,{"alpha":0}); //this does not tween
		}
		else {
			renderer.material.mainTexture.Play();
			audio.Play();
		}
	}
}

It seems straight forward to me. the code above has the iTween stuff commented, so this code just starts the anim/audio, stops it, and restarts it, forever, that works fine.

as mentioned, when i did a MoveTo using iTween, it ONLY moved the little speaker icon, I assume that’s a good hint.

Any help would be greatly appreciated. Thanks. using Unity Pro trial, fwiw a screenshot at http://litstudios.com/unity/unityscreen.jpg

So, is your problem that you can’t get MoveTo() working for ya?

1st, Happy New year and thanks for monitoring these forums like this… I was hoping to hear from you directly but i didn’t imagine you’d be so on top of your game. Thank you! I def plan to donate to your project.

2nd, sorry for the long winded email. I probably could have organized it better. I saw some folks get a talking-to for not providing enough info so…

Ok, so MoveTo() did work and it was the first sign of life in my scriptwriting adventure. The only problematic thing worth mentioning here is that the MoveTo() did not move my whole object (a flat plane) as I expected, the plane with movieTexture applied stayed still but the little speaker icon/gizmo attached to the plane slid across the screen with a tweened motion. Does that mean anything to you?

to be clear, i’m not trying to move anything for my project. i’m trying to fade alpha to 0 and fade audio volume to zero. the reason, as mentioned, is because Unity isn’t great at dealing with stopping and restarting the looped playback of audio attached to the video on the plane. iTween will provide a polish there that’ll make it look pro and i plan to master it, i think i’ll use it a lot.

i’m getting nowhere with alpha, and i can fade audio but the clip doesn’t seem to stop because i can’t trigger the audio at full volume again.

iTween.AudioTo(gameObject,{“volume”:0,“time”:1,“onComplete”:“audioStopped”}); //this tweens
iTween.FadeTo(gameObject,{“alpha”:0}); //this does not tween

and btw, I tried pasting many examples of FadeTo() from these forums and your videos/website. i got no where with any combination of hashes.

thank for taking the time. once i’m on the right track, i promise to make some magic.

Thanks for the support!

I don’t have a ton of time to dig into this at the moment but does the shader you are using on the object calculate transparency? If not iTween won’t be able to fade the object.

This is part one of two pretty old iTween videos (some of what is shown is outdated like the function names) but they should help you a bit.
Part 1: http://www.youtube.com/watch?v=DeIvUfK1PMQ&feature=youtube_gdata_player
Part 2 (I talk about the need for a transparent shader for fades around 2:20): http://www.youtube.com/watch?v=z_yynd8iLeM&feature=youtube_gdata_player

ok great, I’ll look into it. Thanks for the info and links… very much appreciated.

Mr,Pixelplacement! Thank you! i was using a self-illuminating shader… i switched to transparency>diffuse and the fade works now.

I feel like a dummy because I watched both of the videos you linked already - i guess I was concentrating on the code on screen rather than the detail you mentioned about shaders/transparency. things are looking good here… I’ll be sure to post a link to a runtime here when I’m done. Thanks!!!