- Home /
iTween : overload method hashtable not compatible with argument list hash
Hi I'm trying to use iTween to tween the value of a particle emitter and getting this error:
The best overload for the method 'iTween.ValueTo(UnityEngine.GameObject, System.Collections.Hashtable)' is not compatible with the argument list '(UnityEngine.ParticleEmitter, Boo.Lang.Hash)'.
This is my code:
var flameEnergyFlicker = .5;
iTween.ValueTo(flameEmitter,{"maxEnergy": flameEnergyFlicker,"oncomplete":"flickerOff"});
where flameEmitter is the flame emitter attached to a game object, and max energy is a property of the emitter.
Comment
Best Answer
Answer by Wolfram · Jun 14, 2012 at 04:42 PM
Use iTween.Hash("a", b, "c", d)
instead of {"a":b, "c":d}
Also, iTween can only deal with GameObjects, not with Components. So usually you would use the "onupdate" tag to assign a function to the tween (e.g., "OnFlicker"), and then you can write that function and do anything you like in it:
function OnFOVFade(val:float){
flameEmitter.energy=val;
}