I have a iTween Script and I want to add in a Speed Variable to be able to control the Speed in the Inspector. Im new to scripting and need help figuring it out? Or changing the Time variable to be able to modify it in the inspector.
var path : Transform[ ];
function Start ()
{
iTween.MoveTo(gameObject,{“path”:path,“time”:10,“orienttopath”:true,“looktime”:.6,“easetype”:“easeInOutSine”,“oncomplete”:“complete”});
}
function OnDrawGizmos()
{
iTween.DrawPath(path);
}
There is a time variable “time:10” which takes 10 seconds, how would I modify this script to be able to change the variable of 10 in the inspector?
var path : Transform[];
var time : int;
function Start ()
{
iTween.MoveTo(gameObject,{"path"ath,"time":time,"orienttopath":true,"looktime":.6,"e asetype":"easeInOutSine","oncomplete":"complete"}) ;
}
function OnDrawGizmos()
{
iTween.DrawPath(path);
}
Also, iTween now has a “speed” variable which will allow you to set a consistent speed for different situations. Judging by your attempted setup it looks like you are interested in adjusting the iTween’s speed as it plays? If so this isn’t possible. iTween is meant to setup an animation and let it run its course.
Awesome! and such a fast response you guys are great!!!
If I cant change the speed in the inspector for this one its fine at least I know know how to modify the scripts for use in the inspector. Thank you Beezir, apples and pixelplacement1.
var path : Transform[ ];
var time : float;
function Start ()
{
iTween.MoveTo(gameObject,{“path”:path,“time”:time,“orienttopath”:true,“looktime”:.6,“easetype”:“easeInOutSine”,“oncomplete”:“complete”});
}
function OnDrawGizmos()
{
iTween.DrawPath(path);
}